【问题标题】:dotfiles (zsh setup) in GitHub Codespaces: no effectGitHub Codespaces 中的点文件(zsh 设置):无效
【发布时间】:2022-01-22 10:59:01
【问题描述】:

我正在尝试让 GitHub 代码空间识别我的点文件,以自动设置 zsh shell。

当我进入代码空间时,无论是在网络上还是从 VSCode 中,点文件都不起作用。也没有错误信息。

这就是我所做的

  1. 在 GitHub 上创建了一个公共 dotfiles 存储库,其中包含 .zshrcsetup.sh(内容如下)。直接通过 github.com 上的“添加文件”添加文件,然后复制/粘贴。

  2. 通过 github.com > settings > codespaces > use dotfiles = true (checkbox) 在 Codespaces 中启用自动运行点文件

  3. VSCode > 设置 > linux 默认 shell > zsh

setup.sh

#!/bin/bash

git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

cat .zshrc > $HOME/.zshrc

.zshrc

export ZSH="${HOME}/.oh-my-zsh"

ZSH_THEME="robbyrussell"

DISABLE_UNTRACKED_FILES_DIRTY="true"

plugins=(zsh-autosuggestions history-substring-search zsh-syntax-highlighting)

source $ZSH/oh-my-zsh.sh

PROMPT="*** zsh *** %~   "

【问题讨论】:

    标签: github zsh dotfiles github-codespaces


    【解决方案1】:

    我注意到 dotfiles 不会应用于在重新构建代码空间后立即出现的 zsh shell。我仍在研究这个以更好地理解它。启动一个新的 zsh shell 为我解决了这个问题——点文件被应用了。这能为您解决问题吗?

    另外,我建议在 setup.sh 中使用符号链接而不是 cat。更多详情见我的博文:https://bea.stollnitz.com/blog/codespaces-terminal/

    【讨论】:

      猜你喜欢
      • 2022-01-10
      • 2023-01-18
      • 1970-01-01
      • 2022-11-18
      • 2021-10-31
      • 2022-08-05
      • 2021-06-14
      • 2023-02-19
      • 2021-02-18
      相关资源
      最近更新 更多