On ConEmu I'm opening a powershell console. I'd like the title of the tab to reflect the current folder I'm in. However, by default, the title is "Windows Powershell."
I specified the tab title in my task to be "C:\Code" and it updates, but that is hard coded.
Is there a way to open a powershell console, and as I navigate have it show me the current directory in the tab title?
Best Answer
PowerShell
Change
prompt
function in your powershell profile.Open your profile in the editor, Notepad for example
Add following function to change (rename actually) ConEmu tab each time prompt appears
or use following code to change console title, but not tab
May be need to change this code, if you need to use PowerShell outside of ConEmu.
cmd (let it be in one answer)
If you are using
cmd.exe
, you may update ConEmu tab with cmd's current directory usingprompt
and ANSI. Just run your cmd as following:To be able to process ANSI you need to enable
Inject ConEmuHk
andANSI X3.64
options in the ConEmu'sFeatures
settings page (they are enabled by default). RightClick on the ConEmu's window title or press WinAltP to openSettings
dialog.Note,
& title cmd
in the example is not required, just for prettify window caption.