zsh 的回显不能设置么,百度了半天都没找到
Tofloor
poster avatar
呆了个呆
deepin
2015-01-02 01:03
Author
就像 bash 的 PS1 变量,用来设置命令行开头的回显文字,现在 zsh 默认就一个右箭头和一个路径。。。
Reply Favorite View the author
All Replies
iamdsy
deepin
2015-01-02 05:59
#1
我用rc版本的时候每次都输入bash,。。。
Reply View the author
httpe
deepin
2015-01-02 07:42
#2
https://wiki.archlinux.org/index.php/Zsh
这里有教如何设置prompt
Reply View the author
Bluek404
deepin
2015-01-02 09:40
#3
https://wiki.archlinux.org/index.php/Zsh
这里有教如何设置prompt
Arch Wiki简直万能啊……
Reply View the author
hummerstudio
deepin
2015-01-02 22:17
#4
需要手动修改配置文件啊,还是希望能够有图形化的设置界面,勾勾选选是最好的了。哈哈。
Reply View the author
Bluek404
deepin
2015-01-03 00:29
#5
需要手动修改配置文件啊,还是希望能够有图形化的设置界面,勾勾选选是最好的了。哈哈。
会用终端的话一般都会写两行脚本的
小白的话又一般不会需要修改配置
貌似需求不大?
Reply View the author
呆了个呆
deepin
2015-01-03 00:37
#6
那个英文百科看不懂,不过在网上找到个设置,有的方法不行,我现在是这样设置的,留个脚印:

PS1="%{$fg[white]%}%n@%m:%{$reset_color%} "

Linux 的剪贴板也坑爹,程序关了可能就会被清空,Windows 重没听说过
Reply View the author
呆了个呆
deepin
2015-01-03 00:40
#7
zsh 不知道有没有路径只要目录的参数,只找到 %d 和 %~ 都是完整路径的
bash 下就有 \w 和 \W 完整路径和光目录的参数
Reply View the author
httpe
deepin
2015-01-04 02:40
#8
zsh 不知道有没有路径只要目录的参数,只找到 %d 和 %~ 都是完整路径的
bash 下就有 \w 和 \W 完整路径和光目录的参数
%d
    Current working directory. If an integer follows the ‘%’, it specifies a number of trailing components of the current working directory to show; zero means the whole path. A negative integer specifies leading components, i.e. %-1d specifies the first component.
这里有全部的变量说明:
http://zsh.sourceforge.net/Doc/Release/ ... nsion.html
Reply View the author
httpe
deepin
2015-01-04 02:41
#9
[quote]https://wiki.archlinux.org/index.php/Zsh
这里有教如何设置prompt
Arch Wiki简直万能啊……[/quote]
我见过文档最齐全的发行版就是Arch和Gentoo了~
非常适合小白+懒得百度的用户
Reply View the author
jiuny0209
deepin
2015-01-07 21:27
#10
zsh 不知道有没有路径只要目录的参数,只找到 %d 和 %~ 都是完整路径的
bash 下就有 \w 和 \W 完整路径和光目录的参数

  export ps1_path=$(print -Pn "%F{red}%c%f")
    export PS1="$(print -Pn %F{green}\[%f)${ps1_path}$(print -Pn %F{green}\]%f\#%F{blue}) "

顯示目前路徑非完整,~是紅色 []綠色 #黑色

[~]# ls
Reply View the author
Feng Yu
deepin
2015-01-07 23:10
#11
deepin用的zsh配置是oh-my-zsh,这玩意自带N多漂亮的主题,选一个你喜欢的主题吧。https://github.com/robbyrussell/oh-my-zsh/wiki/themes

PS: 我用的是"agnoster"这个主题,需要给自己打powerline字体补丁,可以显示一些特殊的字符,比如分支,箭头符号等等,效果图:
Reply View the author
runsisi
deepin
2015-01-12 22:03
#12
deepin用的zsh配置是oh-my-zsh,这玩意自带N多漂亮的主题,选一个你喜欢的主题吧。https://github.com/robbyrussell/oh-my-zsh/wiki/themes

PS: 我用的是"agnoster"这个主题,需要给自己打powerline字体补丁,可以显示一些特殊的字符,比如分支,箭头符号等等,效果图:

好吧 其实都很丑。。
我只需要经典的能够显示当前路径的提示符就行,即bash的w所显示的内容,其他任何东西都不需要。。 有推荐的吗?
Reply View the author
runsisi
deepin
2015-01-12 22:08
#13
deepin用的zsh配置是oh-my-zsh,这玩意自带N多漂亮的主题,选一个你喜欢的主题吧。https://github.com/robbyrussell/oh-my-zsh/wiki/themes

PS: 我用的是"agnoster"这个主题,需要给自己打powerline字体补丁,可以显示一些特殊的字符,比如分支,箭头符号等等,效果图:
找到了。。
cypher 这个主题挺漂亮的,当然前提是终端颜色是黄底黑字。。
Reply View the author