Hiding the full file path in a PowerShell command prompt in VSCode

Hiding the full file path in a PowerShell command prompt in VSCode



So I've just downloaded Visual Studio Code to use as my default IDE for learning Python. I'm running on a 64-bit machine so I made the default terminal windows powershell.



The place where I'll be saving most of my files is about 8 folders deep which all show up in the terminal before any commands can be written. Is there any way to hide or shorten the file path in the terminal?





Have you tried asking this question at superuser.com This is a stack exchange where power users answer questions like this.
– Biclops
Aug 31 at 1:04




1 Answer
1



As @Biclops suggested, there is good info here: configure PowerShell to only show the current folder in the prompt



However, I needed more basic info to get this to work. This is a very good resource to get started: Windows PowerShell Profiles. So I first followed the steps suggested there:



[always using vscode's integrated terminal using PowerShell]


test-path $profile


new-item -path $profile -itemtype file -force


notepad $profile



paste in (from the SuperUser answer above)


function prompt
$p = Split-Path -leaf -path (Get-Location)
"$p> "


Set-ExecutionPolicy RemoteSigned -Scope CurrentUser





You could also do "$pwd".Split('')[-1] + '> ' to be shorter
– TheIncorrigible1
Aug 31 at 2:37


"$pwd".Split('')[-1] + '> '





I wish javascript had negative indexes to arrays.... that would be so useful.
– Mark
Aug 31 at 2:55





Join the .NET darkside (actually, I don't think C# has neg indeces either)
– TheIncorrigible1
Aug 31 at 2:56



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Some of your past answers have not been well-received, and you're in danger of being blocked from answering.



Please pay close attention to the following guidance:



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)