Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Powershell tab title issue #528

Closed
edclement opened this issue Jun 10, 2015 · 1 comment
Closed

Powershell tab title issue #528

edclement opened this issue Jun 10, 2015 · 1 comment
Labels

Comments

@edclement
Copy link

Under Settings>Main>Tabs, if you use a tab template of "%f" (folder) or "%d" (current directory) for the tab name and use powershell as your prompt, the tab title won't actually update with the current directory. If you do use cmd.exe as your prompt instead, the tab title does update properly. I managed to figure out the fix for this. Adding this line:
& ConEmuC64 -StoreCWD "$dir"
...to the cmder\vendor\profile.ps1 powershell profile as the last statement of the function global:prompt { function does allow for the tab title to update properly on directory navigation.
So the full function looks like:

function global:prompt {
    $realLASTEXITCODE = $LASTEXITCODE
    $Host.UI.RawUI.ForegroundColor = "White"
    Write-Host $pwd.ProviderPath -NoNewLine -ForegroundColor Green
    if($gitStatus){
        checkGit($pwd.ProviderPath)
    }
    $global:LASTEXITCODE = $realLASTEXITCODE
    Write-Host "`nλ" -NoNewLine -ForegroundColor "DarkGray"
    & ConEmuC64 -StoreCWD "$dir"
    return " "
}

Can one of the project maintainers add this one liner?

@Jackbennett
Copy link
Contributor

That line & ConEmuC64 -StoreCWD "$dir" doesn't do anything for me even & ConEmuC64 -StoreCWD "test"

I don't see $dir defined in your post I'm not even sure how yours is working.

The line I get it to work with is: conemuC -GuiMacro Rename 0 'tabname' but putting that into the prompt slows it down by a few tenths which I don't find acceptable. I tried running it as a background task and it's just as slow.

I added the host process title in though so at least windows knows that process's name by it's directory. You see this in the start aero peak list of cmders open tabs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants