zsh

Java_HOME not found when changed shell from Bash to Zsh on OSX?

不问归期 提交于 2021-01-17 08:11:24
问题 This is weird, I have set JAVA_HOME for my mac which can be found when I am using bash shell, but if I change shell, I get a message saying JAVA_HOME not set. What could be going on here? 回答1: When you set JAVA_HOME in a shell, then it is active and available only for that context, and it will be gone when you close that shell. Instead either change global environment (or) your .bashrc to include it. So that every time you start a shell, the variable will be available. edit the .profile or

Java_HOME not found when changed shell from Bash to Zsh on OSX?

偶尔善良 提交于 2021-01-17 08:09:05
问题 This is weird, I have set JAVA_HOME for my mac which can be found when I am using bash shell, but if I change shell, I get a message saying JAVA_HOME not set. What could be going on here? 回答1: When you set JAVA_HOME in a shell, then it is active and available only for that context, and it will be gone when you close that shell. Instead either change global environment (or) your .bashrc to include it. So that every time you start a shell, the variable will be available. edit the .profile or

Java_HOME not found when changed shell from Bash to Zsh on OSX?

谁都会走 提交于 2021-01-17 08:05:49
问题 This is weird, I have set JAVA_HOME for my mac which can be found when I am using bash shell, but if I change shell, I get a message saying JAVA_HOME not set. What could be going on here? 回答1: When you set JAVA_HOME in a shell, then it is active and available only for that context, and it will be gone when you close that shell. Instead either change global environment (or) your .bashrc to include it. So that every time you start a shell, the variable will be available. edit the .profile or

Docusaurus2 快速建站,发布 GitHub Pages

白昼怎懂夜的黑 提交于 2021-01-15 01:43:21
Docusaurus2 可快速搭建文档、博客、官网等网站,并发布到 GitHub Pages, Serverless 等。 我们只需 Markdown 写写内容就行,也可直接编写 React 组件嵌入。而 SEO、搜索、版本等都友好支持了。 另外重要的一点是此项目是 Facebook 开源维护的,他们自己也在用,所以质量、长久性能有所保证。 代码: https://github.com/ikuokuo/start-docusaurus2 演示: https://ikuokuo.github.io/start-docusaurus2/ 👀 前提准备 Node.js version >= 10.15.1 Yarn version >= 1.5 ❯ node -v v12.18.4 ❯ yarn version yarn version v1.22.10 创建项目 # npx @docusaurus/init@latest init [name] [template] npx @docusaurus/init@latest init my-website classic 运行输出: Success! Created my-website Inside that directory, you can run several commands: yarn start Starts the

zsh autocomplete slow for ssh

▼魔方 西西 提交于 2021-01-05 06:29:59
问题 I upgraded my macbook to OSX Catalina recently. Ever since that upgrade my zsh autocomplete (tab completion) for ssh is really slow (previously, it was reasonably fast, e.g. autocomplete would happen in a few seconds). Some details that I think are relevant: I have a ~/.ssh/config file with ~2000 hosts configured When I type ssh x <TAB> things seem to hang, typing ctrl-C says Killed by signal in _ssh_hosts after 22s so it seems that my _ssh_hosts script is the problem Any tips on how to debug

zsh autocomplete slow for ssh

回眸只為那壹抹淺笑 提交于 2021-01-05 06:29:37
问题 I upgraded my macbook to OSX Catalina recently. Ever since that upgrade my zsh autocomplete (tab completion) for ssh is really slow (previously, it was reasonably fast, e.g. autocomplete would happen in a few seconds). Some details that I think are relevant: I have a ~/.ssh/config file with ~2000 hosts configured When I type ssh x <TAB> things seem to hang, typing ctrl-C says Killed by signal in _ssh_hosts after 22s so it seems that my _ssh_hosts script is the problem Any tips on how to debug

Proper way to use a trap to exit a shell-script in ZSH?

时间秒杀一切 提交于 2021-01-03 06:58:23
问题 I'm having trouble getting a trap function in a Zshell-script to work without exiting the shell. I have a simple countdown timer that I want to be able to interrupt using ^C, and when I do I want the trap to change the cursor status in the terminal. My syntax is: #!/bin/zsh trap 'tput cnorm; exit' INT TERM I've also tried: trap 'tput cnorm; kill -9 $$' INT TERM Both interrupts exit the shell entirely. How do I only exit the script and return to the command line? Any guidance will be most

Proper way to use a trap to exit a shell-script in ZSH?

梦想与她 提交于 2021-01-03 06:57:29
问题 I'm having trouble getting a trap function in a Zshell-script to work without exiting the shell. I have a simple countdown timer that I want to be able to interrupt using ^C, and when I do I want the trap to change the cursor status in the terminal. My syntax is: #!/bin/zsh trap 'tput cnorm; exit' INT TERM I've also tried: trap 'tput cnorm; kill -9 $$' INT TERM Both interrupts exit the shell entirely. How do I only exit the script and return to the command line? Any guidance will be most

帅气逼人的终端环境

不打扰是莪最后的温柔 提交于 2021-01-02 14:04:57
来源:https://blog.biezhi.me/2018/11/build-a-beautiful-mac-terminal-environment.html 如果你觉得当前的终端操作不符合你的气质,可以看看我今天来介绍的 Mac 终端利器,不过不会介绍太多细节操作。 它们是谁? iTerm2:号称 Mac 下最好的终端工具(嗯,我也这么认为,毕竟我不会别的了) zsh:一款强大的终端工具,能帮助你更高效地编写和执行命令。 安装 iTerm2 下面的安装我几乎都用 brew 方式了,如果你还不懂什么是 brew 可以看看 这个。 所以下面我假设你已经安装了 Homebrew 。 如果你从来没有运行过 brew cask 命令,可以先执行: brew tap caskroom/cask 多执行也不会怀孕的,放心! 然后开始安装 iTerm2 brew cask install iterm2 安装成功后在 Launchpad 中可以看到有一个新图标出现,打开 iTerm2。 代码配色 默认的界面还是略显丑陋的,我们来设置一下代码配色吧。 iTerm2 设置 先检查下终端颜色配置为 xterm-256color ,位置在 iTerm2 -> Preferences -> Profiles -> Terminal 。 iTerm2 终端颜色值 然后就可以设置配色了,默认情况下

git completion in zsh: __git_func_wrap:3: : not found

风格不统一 提交于 2020-12-30 07:45:53
问题 git-completion.zsh and git-completion.bash are installed automatically when running brew install git : ❯ ls -l /usr/local/share/zsh/site-functions/_git lrwxr-xr-x 56 quanta 7 Jul 18:54 /usr/local/share/zsh/site-functions/_git -> ../../../Cellar/git/2.27.0/share/zsh/site-functions/_git ❯ ls -l /usr/local/share/zsh/site-functions/git-completion.bash lrwxr-xr-x 71 quanta 7 Jul 18:54 /usr/local/share/zsh/site-functions/git-completion.bash -> ../../../Cellar/git/2.27.0/share/zsh/site-functions/git