ZSH:在终端中隐藏计算机名称 [英] ZSH: Hide computer name in terminal

查看:67
本文介绍了ZSH:在终端中隐藏计算机名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在使用终端时在提示中隐藏计算机名称?

How would I hide the computer name in the prompt while using the terminal?

目前它同时显示用户名和计算机名称,如下所示:

At the moment it shows both username and computer name like so:

删除 anwarchoukah@anwars-mbp 会节省一些空间,因为我真的知道我是谁:)

It would save some space by removing anwarchoukah@anwars-mbp, seeing as I actually know who I am:)

推荐答案

打开 .zshrc,找到读取 export PS1export PROMPT.

Open up .zshrc, find the line reading export PS1 or maybe export PROMPT.

删除用于主机名的变量,可以是 %m 或 %M.

Remove the variable that is used for the hostname, could be %m or %M.

Archlinux wiki 上的 Zsh

您可以使用颜色并在右侧显示提示(或一些信息).

You can use colors and also have a prompt (or some information) on the right side.

这篇关于ZSH:在终端中隐藏计算机名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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