Closed saumyajyoti closed 1 year ago
@saumyajyoti are you using the correct and up to date clink? The debug log should also show that, I think you removed that part.
Hi @JanDeDobbeleer Yes I am using latest Clink 1.5.2. Adding the initial portion of the log.
ξΆο cmd ξ° ξ ξ π~ oh-my-posh.exe debug --plain
Version: 18.3.3
Shell: cmd (clink v1.5.2.0f063a)
Prompt:
ξΆπ€ smukhe5 @ s-deskξ°ξ°0 π ξ°ξ°0msξ΄ ξΆ23:21:25ξ΄ ξΆο cmd ξ° ξ ξ
Segments:
ConsoleTitle(true) - 7 ms Session(true) - 0 ms Path(true) - 5 ms Git(false) - 17 ms Node(false) - 0 ms Python(false) - 0 ms Root(false) - 0 ms Executiontime(true) - 0 ms Time(true) - 0 ms Shell(true) - 0 ms Exit(true) - 0 ms
Run duration: 49.845ms
Cache path: C:\Users\smukhe5\AppData\Local\oh-my-posh
Config path: U:\POSH\saumya-prompt.omp.json
Logs:
[DEBUG] 23:21:25.920 shell.go:Getenv:389 β NO DATA [TRACE] 23:21:25.920 shell.go:Getenv(TERM_PROGRAM) - 512.8Β΅s [DEBUG] 23:21:25.920 shell.go:Getenv:389 β C:\Users\smukhe5\AppData\Local [TRACE] 23:21:25.920 shell.go:Getenv(LOCALAPPDATA) - 0s [TRACE] 23:21:25.920 shell_windows.go:CachePath() - 0s [DEBUG] 23:21:25.921 shell.go:Getenv:389 β U:\POSH\saumya-prompt.omp.json [TRACE] 23:21:25.921 shell.go:Getenv(POSH_THEME) - 0s [DEBUG] 23:21:25.921 shell.go:Shell:629 β no shell name provided in flags, trying to detect it [DEBUG] 23:21:25.934 shell.go:Shell:637 β process name: cmd.exe [TRACE] 23:21:25.934 shell.go:Shell() - 12.3865ms [TRACE] 23:21:25.934 shell.go:resolveConfigPath() - 12.3865ms [TRACE] 23:21:25.934 shell.go:Init() - 14.3417ms [TRACE] 23:21:25.934 shell.go:Flags() - 0s [TRACE] 23:21:25.935 config.go:loadConfig() - 1.4054ms [TRACE] 23:21:25.935 shell.go:Flags() - 0s [DEBUG] 23:21:25.935 shell.go:Getenv:389 β NO DATA [TRACE] 23:21:25.935 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s [TRACE] 23:21:25.935 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [TRACE] 23:21:25.935 shell.go:GOOS() - 0s [DEBUG] 23:21:25.936 shell_windows.go:WindowsRegistryKeyValue:215 β ColorizationColor(DWORD): 0xC4459BAC [TRACE] 23:21:25.936 shell.go:Shell() - 0s [DEBUG] 23:21:25.936 shell.go:Getenv:389 β clink v1.5.2.0f063a [TRACE] 23:21:25.936 shell.go:Getenv(POSH_SHELL_VERSION) - 0s [DEBUG] 23:21:25.936 debug.go:PrintDebug:22 β Segment: Title [TRACE] 23:21:25.936 shell_windows.go:Root() - 0s [TRACE] 23:21:25.936 shell.go:Shell() - 0s [TRACE] 23:21:25.936 shell.go:StatusCodes() - 0s [TRACE] 23:21:25.936 shell_windows.go:IsWsl() - 0s [DEBUG] 23:21:25.942 shell.go:TemplateCache:810 β environment: [=C:=C:\Users\smukhe5 =clink.bin=C:\tools\cmdermini\vendor\clink =clink.id=29732 =clink.profile=C:\tools\cmdermini\config =clink.scripts=C:\tools\cmdermini\vendor =ExitCode=00000000 add_path=C:\tools\cmdermini add_to_path=C:\tools\cmdermini aliases=C:\tools\cmdermini\config\user_aliases.cmd ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\smukhe5\AppData\Roaming architecture_bits=64 ccall=call "C:\tools\cmdermini\vendor\bin\cexec.cmd" cexec="C:\tools\cmdermini\vendor\bin\cexec.cmd"
@saumyajyoti something to check after my holidays in this case. Bit tricky to see the issue on mobile. Can you perhaps also provide a screenshot?
Highlighted the extra chars in prompt.
@saumyajyoti does this also happen in Windows Terminal BTW? Because console title ANSI sequence interpretation is a terminal feature.
@JanDeDobbeleer , I tested it on Windows terminal Version: 1.17.12191.0, with PWSH and CMD/Clink. and also in Cmder / Conemu UI. Both showed the problem. WIndows terminal with PWSH Shell works fine. cmd/Clink shows the issue.
@saumyajyoti this seems to be a bug in clink. When you remove the folder icon, it works correctly. Using PowerShell I can use that character for the console title and it shows correctly. Can you create a bug on their end? cc. @chrisant996
Thanks for the debug and root cause. :) Sure, I'll do.
@saumyajyoti Thanks for reporting this. The fix will be available in the next published release, probably later this week or next week.
If the prompt string contains OSC 2 ; string {EMOJI} BEL
then the OSC code is stripped and the string {EMOJI}
part shows up in the prompt.
The same problem occurs for any OSC code containing any UTF8 content beyond ASCII characters (not just for emoji).
Commit https://github.com/mridgers/clink/commit/9557d06c8cdf39ad995d8bd18284a71c8c218bec on May 6, 2016 introduced support for OSC codes in the ecma48 parser for escape codes. It mistakenly used CSI code rules for valid characters for OSC codes, as well. It's been that way for over 8 years without being noticed/reported.
Thanks @chrisant996 for the quick fix.
This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.
Code of Conduct
What happened?
A bug happened! For Cmder/Clink based prompt. The Console title template does not tale effect. The Title does not change but it appends title text to prompt text:
Theme
Using My Custom theme with below Title template. "console_title_template": "{{.UserName}}@{{.HostName}} π{{ .PWD }}",
What OS are you seeing the problem on?
Windows
Which shell are you using?
cmd
Log output