提示中的变量名而不是路径 [英] Variable names in prompt instead of path

查看:66
本文介绍了提示中的变量名而不是路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何防止zsh提示符显示分配给路径的变量名而不是路径本身?

How can I prevent my zsh prompt from showing the variable name a path is assigned to instead of the path itself?

foo="/some/path"
cd "$foo"

显示 $〜foo / 在我的提示下,代替 $ / some / path /

shows $ ~foo/ in my prompt instead $ /some/path/

推荐答案

从评论中:

您正在看到命名目录。检查是否设置了 AUTO_NAME_DIRS setopt | grep AUTO_NAME_DIRS )-要禁用此功能,请将其关闭。

you're seeing Named Directories. Check if AUTO_NAME_DIRS is set (setopt | grep AUTO_NAME_DIRS) - to disable this functionality, turn it off.

这篇关于提示中的变量名而不是路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆