首页 > 解决方案 > 如何从 powershell 提示符中删除“username@host”?

问题描述

1.PowerShell, 2.WSL在我的 Windows 10 机器中使用带有 shell 的 Windows 终端(预览版)。我安装了最新版本的oh-my-poshposh-git自定义终端。我当前的主题是Agnoster提供丰富多彩的自定义提示。但我想从提示中删除“username@host”。

例如:

当前=>用户名@主机D:\文件夹名称>

需要=> D:\文件夹名>

我尝试了一些$GitPromptSettings变量以及 GitPrompt.ps1posh-git 文件夹内的文件但没有用的东西。

另外,因为我有 oh-my-posh 和 posh-git,它们是否都具有提示自定义属性或者它只是来自 posh-git?

任何帮助表示赞赏。

标签: powershell-4.0posh-gitwindows-terminal

解决方案


从中删除类型为会话的段~\Documents\WindowsPowerShell\Modules\oh-my-posh\3.101.23\themes\<themename>.omp.json


推荐阅读