删除 zsh shell 中每一行的时间戳

Gag*_*age 3 unix macos shell zsh oh-my-zsh

我正在尝试使用 ZSH 从我的终端 (macOS) 中删除当前时间戳。我正在使用 oh-my-zsh 并且配置了主题“pure”。

\n\n

时间戳出现在每行最右侧的括号中,我不知道如何删除它。

\n\n

示例: \n时间戳在右侧以红色突出显示。

\n\n

更新:终端输出示例,我想[17:29:47]从每一行中删除等。

\n\n
\xe2\x9d\xaf cd ~                                                                         [17:29:47]\n\n~\n\xe2\x9d\xaf ls                                                                           [17:29:49]\nApplications Documents    Library      Music        Projects\nDesktop      Downloads    Movies       Pictures     Public\n\n~\n\xe2\x9d\xaf ls -l                                                                        [17:29:51]\ntotal 0\ndrwx------@  4 gage  staff   128 Mar  4 22:27 Applications\ndrwx------@  4 gage  staff   128 Mar  7 15:39 Desktop\n
Run Code Online (Sandbox Code Playgroud)\n\n

任何帮助将不胜感激,谢谢!

\n

小智 13

我能够删除主题中显示的整个右侧部分\xe2\x9c\x94 \xee\x82\xb2 123 \xee\x82\xb2 10:46:22

\n

打开zshrc

\n

open ~/.zshrc

\n

将以下行粘贴到文件末尾。这会隐藏右侧部分\nPOWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()

\n

谢谢!

\n


小智 5

转到 /Users/your_username/ .p10k.zsh文件并搜索RIGHT_PROMT_ELEMENTS并在其下注释时间和状态。

typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
    # status                  # exit code of the last command ( commented)
    command_execution_time  # duration of the last command
    background_jobs         # presence of background jobs
    direnv                  # direnv status (https://direnv.net/)
    asdf                    # asdf version manager (https://github.com/asdf-vm/asdf)
    virtualenv              # python virtual environment (https://docs.python.org/3/library/venv.html)
    anaconda 
  # time                    # current time
    # ip                    # ip address and ba
Run Code Online (Sandbox Code Playgroud)