所以我刚刚下载了 Visual Studio Code 作为我学习 Python 的默认 IDE。我在 64 位机器上运行,所以我制作了默认的终端 windows powershell。
我将保存大部分文件的地方大约有 8 个文件夹深,这些文件夹在写入任何命令之前都显示在终端中。有什么办法可以隐藏或缩短终端中的文件路径吗?
最佳答案
正如@Biclops 所建议的,这里有很好的信息:configure PowerShell to only show the current folder in the prompt
但是,我需要更多基本信息才能使其正常工作。这是一个非常好的入门资源:Windows PowerShell Profiles .所以我首先按照那里建议的步骤进行操作:
【一直使用vscode的集成终端使用PowerShell】
test-path $profile
(是否设置了配置文件?)new-item -path $profile -itemtype file -force
(假设以上答案为假)notepad $profile
(打开记事本)function prompt {
$p = Split-Path -leaf -path (Get-Location)
"$p> "
}
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
(在您的集成终端 PS 提示符下,也来自 super 用户的回答)关于powershell - 在 VSCode 的 PowerShell 命令提示符中隐藏完整文件路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52107170/