在配置文件中添加到ZSH提示的末端的空间字符被忽略。如何添加间距?
上下文:
- 我正在使用iterm2
- 我的配置文件设置为
〜/.zshrc
- 我的当前提示/code>
其他未返回所需行为的提示值:
export PS1=$'%d ~
Context:
- I am using iterm2
- my profile is set to
~/.zshrc
- my current prompt is set with the following in my profile
export PS1=$'%d ~ ???? # \40'
Other prompt values that did not return the desired behaviour:
export PS1=
My current prompt looks like this:
user #
When I type something, the text appears directly next to the prompt:
user #echo 'test'
I am attempting to achieve the following behavior (?)/layout with the prompt:
user# echo 'test'
Where there is a space between my code and the prompt.
Why isn't the space displaying?
Additional context:
I am using a MBP with an M1 chip.
Update: per @Jeff Schaller's suggestion I have tried PS1=$'%d ~ <0001f370> # '
which also did not work
%d ~ ???? # \32'
export PS1=
My current prompt looks like this:
When I type something, the text appears directly next to the prompt:
I am attempting to achieve the following behavior (?)/layout with the prompt:
Where there is a space between my code and the prompt.
Why isn't the space displaying?
Additional context:
I am using a MBP with an M1 chip.
Update: per @Jeff Schaller's suggestion I have tried PS1=$'%d ~ <0001f370> # '
which also did not work
%d ~ ???? # \160'
export PS1=
My current prompt looks like this:
When I type something, the text appears directly next to the prompt:
I am attempting to achieve the following behavior (?)/layout with the prompt:
Where there is a space between my code and the prompt.
Why isn't the space displaying?
Additional context:
I am using a MBP with an M1 chip.
Update: per @Jeff Schaller's suggestion I have tried PS1=$'%d ~ <0001f370> # '
which also did not work
%d ~ ???? # '
My current prompt looks like this:
When I type something, the text appears directly next to the prompt:
I am attempting to achieve the following behavior (?)/layout with the prompt:
Where there is a space between my code and the prompt.
Why isn't the space displaying?
Additional context:
I am using a MBP with an M1 chip.
Update: per @Jeff Schaller's suggestion I have tried PS1=$'%d ~ <0001f370> # '
which also did not work
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我尝试了您的
导出ps1 = $'%d〜
I tried your
export PS1=$'%d ~ ???? # '
and it worked the way you want, with the space. I’m using the kitty terminal on Debian. I suspectiterm2
is doing something weird.