我的提示符有问题(https://gist.github.com/zackp30/ccf91d6e476f1b6b8ec4),它只显示“anothertest”,但它应该切换每个命令,如果有帮助,$ PS1设置为“anothertest”,而不是_zprompt_init函数,任何帮助将不胜感激,我也确保设置了prompt_subst。 谢谢,扎克。
答案 0 :(得分:0)
错误在第10行的比较中:
if [[ a == 1 ]] ; then
必须是:
if [[ $a == 1 ]] ; then
为了回忆参数的值,您必须在其名称前添加$
。