chrisant996 / clink

Bash's powerful command line editing in cmd.exe
https://chrisant996.github.io/clink/
GNU General Public License v3.0
3.44k stars 135 forks source link

Incorrect shell type in the window title: `Windows PowerShell` #648

Closed andry81 closed 1 month ago

andry81 commented 1 month ago

If start a clean console window as cmd.exe, the title has an incorrect shell type.

OS: Windows 8.1

clink info

version          : 1.6.18.80e2a3
injected         : clink_dll_x64.dll
system           : 6.3.09600.20778
codepage         : 1251
keyboard langid  : 1033
keyboard layout  : 00000409
chrisant996 commented 1 month ago

If start a clean console window as cmd.exe, the title has an incorrect shell type.

Specifically which way is being used to start a clean console window?

If the title bar says "Windows Powershell", then probably Windows Powershell was started, not cmd.exe.

Are you using Windows Terminal? If so, then by default, starting Windows Terminal opens a Powershell tab. That's configurable in Windows Terminal and isn't related to Clink.

andry81 commented 1 month ago

Specifically which way is being used to start a clean console window?

WIN+R, cmd.exe

If the title bar says "Windows Powershell", then probably Windows Powershell was started, not cmd.exe.

No, Task Manager shows cmd.exe

Are you using Windows Terminal?

No.

chrisant996 commented 1 month ago

What is the full output from running clink autorun show?

I think there must be another program hooking into CMD AutoRun and changing the window title.

Or, does the issue go away if you turn off checking for updates by running clink set clink auto update off?

I do not experience this issue on Windows 8.1, and I've never heard of anything like this. So I don't have any ready answers, and I'm trying to help you troubleshoot what's going on.

andry81 commented 1 month ago

Or, does the issue go away if you turn off checking for updates by running clink set clink auto update off?

Seems this is the cause.

chrisant996 commented 1 month ago

Or, does the issue go away if you turn off checking for updates by running clink set clink auto update off?

Seems this is the cause.

That's strange; I'm not able to reproduce that on Windows 8.1. There must be something more involved as well, which we haven't found yet.

What is the output from clink autorun show?

chrisant996 commented 1 month ago

I finally found a way to reproduce the issue where Windows PowerShell on Win8.1 alters the title bar and doesn't restore it. It seems to be an issue in PowerShell v4.0 that comes with Win8.1. It does not occur in PowerShell v5.0 or higher, which come with Win10 or higher.

I'm adding a workaround to block PowerShell from being able to alter the title bar in the first place.