看板 Linux 關於我們 聯絡資訊
最近開始嘗試 bash 以外的 shell, 先嘗試了 zsh 配合 oh-my-zsh, 結果套用某主題時,tty 顯示異常, 可能是中文資料夾的關係, 接下來試了 fish,真的太好用了, 但他不是 POSIX 相容,語法不同, 作者認為 POSIX 太垃圾, 他的語法也確實比較好用合邏輯, 但在 Linux 還是需要通用的東西呀! 請問有兩者兼顧的 shell 嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.35.210.216 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1611448734.A.558.html
dododavid006: zsh 換搭別的主題試試呢?你說的 tty 真的是那個 01/24 09:00
dododavid006: tty ? 01/24 09:00
penut85420: 我自己用oh-my-zsh+powerlevel10k問題是不太大 01/24 09:15
penut85420: 能說看看你的顯示異常是什麼問題嗎? 01/24 09:15
roccqqck: zsh通常是字型問題吧 改gentoo主題試試 01/24 12:08
s9209122222: gentoo 主題真的很通用,和我的 bash 有 99 分像 01/24 12:15
s9209122222: tty 顯示圖片那些好像會有問題 01/24 12:16
s9209122222: 現在有問題了,已經套用 powerlevel10k,但沒有 auto 01/24 12:21
s9209122222: -completion 01/24 12:21
s9209122222: 她根本不能自動輸入套件名稱 01/24 12:54
s9209122222: 不像 bash-completion 和 fish 01/24 13:08
s9209122222: 裝 zhs-completions 也沒作用 01/24 13:28
s9209122222: zsh 01/24 13:28
btzhang2718: 不要用oh-my-zsh 直接把mod的*zsh檔貼到zshrc就好 01/24 17:14
dododavid006: 不能 completion 試試把 ~/.zcompdump 砍掉後重開呢 01/24 17:40
s9209122222: 刪過了,沒用 01/24 17:53
直接貼我的設定給大家看好了,有註解的部份我就刪掉以免篇幅過長 if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi ZSH=/usr/share/oh-my-zsh/ ZSH_THEME="powerlevel10k/powerlevel10k" DISABLE_AUTO_UPDATE="true" ZSH_CUSTOM=/usr/share/zsh plugins=( git zsh-syntax-highlighting zsh-autosuggestions zsh-completions history-substring-search ) ZSH_CACHE_DIR=$HOME/.cache/oh-my-zsh if [[ ! -d $ZSH_CACHE_DIR ]]; then mkdir $ZSH_CACHE_DIR fi source $ZSH/oh-my-zsh.sh # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh ※ 編輯: s9209122222 (114.35.210.216 臺灣), 01/24/2021 18:20:39
EdwardGJLee: bash 不好嗎?可以用 fish,寫程式用 bash。 01/24 19:01
s9209122222: 不要,我要通用的 01/24 19:14
s9209122222: fish 太好用,回不去 01/24 19:14
EdwardGJLee: 就是繼續 fish 當介面。寫程式才用 bash。沒有通用的 01/24 19:25
EdwardGJLee: 很多人也是用 C shell 當介面,寫程式用 bash。 01/24 19:25
EdwardGJLee: 用 fishi + bash|perl|ruby|python 程式可能更實用? 01/24 19:27
EdwardGJLee: fish 發展也有十五年以上,為什麼沒有熱起來?想想看 01/24 19:29
s9209122222: 所以想說把 ZSH 設定到接近 FISH,但他就是沒辦法自 01/24 19:38
s9209122222: 動搜尋套件名稱 01/24 19:38
EdwardGJLee: https://github.com/zsh-users/zsh-completions 01/24 19:40
s9209122222: 就是用了沒辦法呀 01/24 19:46
EdwardGJLee: 提 issue 呀! 01/24 19:47
s9209122222: 提過了呀 01/24 19:48
EdwardGJLee: https://tinyurl.com/y4ql2lm4 01/24 19:48
EdwardGJLee: 用過 git 的版本了嗎? 01/24 19:50
s9209122222: 有試過,但等下再試一次看看 01/24 19:50
EdwardGJLee: https://pkgs.org/search/?q=zsh-completions 01/24 19:52
EdwardGJLee: arch 第三方有 git 版本。 01/24 19:53
EdwardGJLee: 你的 issue 這樣提,人家不曉得要如何回應…… 01/24 20:21
s9209122222: 我也不曉得該怎麼問呀,試了完全照 github 的方式裝 01/24 21:12
s9209122222: 還是不行 01/24 21:12
EdwardGJLee: 把 .zshrc 相關設定暫時保存。裸進 zsh 能用嗎? 01/24 22:31
EdwardGJLee: 我剛試了一下,安裝好就能用。 01/24 22:31
s9209122222: 裸進不能用,但那位開發者給解答了 01/24 22:54
We do not provide the pacman completion file. And it is provided by pacman itself. https://git.archlinux.org/pacman.git/tree/scripts/completion/zsh_completion.in It says # copy this file to /usr/share/zsh/site-functions/_pacman. Please copy it and retry. 創建那個檔案把內容複製過去後,我刪除 .zcompdump 後重開就有了。 ※ 編輯: s9209122222 (114.35.210.216 臺灣), 01/24/2021 22:55:39
s9209122222: 所以到底…… 01/24 22:55
EdwardGJLee: arch 人不用 zsh?BTW, I use Slackware. XD 01/24 23:05
s9209122222: Arch 預設 ZSH 呀 01/24 23:13
s9209122222: yay 也是去 github 上面抓他們 completions 下來 01/24 23:13
s9209122222: 才解決的…… 01/24 23:13
※ 編輯: s9209122222 (114.35.210.216 臺灣), 01/24/2021 23:14:42
Arbin: arch 已經預設在 base 包是 zsh 了嗎...之前還是 bash 的 01/25 10:34
Arbin: 說 01/25 10:34
brli7848: arch只有安裝映像是進zsh初始系統還是bash 01/25 11:12
Gold740716: 不一定要堅持 posix 相容吧,一些需要相容的地方,可 01/25 11:33
Gold740716: 以直接改用 python perl 等腳本語言寫,如果不喜歡 01/25 11:34
Gold740716: posix shell 的話 01/25 11:34
VdustR: 我平常也都用 fish 但 script 或貼上別人的語法會進 bash 01/25 13:19
rot13: 個人用zsh加zprezto 01/25 18:34
s9209122222: 結果最後直接照 archwiki 的方式最快也最簡單…… 01/27 12:05