JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
16.79k stars 2.35k forks source link

Themes with prompt on its own line adds extra space when interrupting FZF #4123

Closed sim590 closed 1 year ago

sim590 commented 1 year ago

Code of Conduct

What happened?

When interrupting FZF's "PSReadlineChordReverseHistory" functionality (CTRL-R mapping), extra space can sometimes (easy to reproduce) add before the prompt just like on the following screen capture (theme here is amro):

image

You can see here that the space highlighted in red shouldn't be there as normal prompt should look like this:

image

Notice how the space goes away once you call back pwsh.exe.

Here is a screen shot of a call to the FZF PSReadlineChordReverseHistory functionality:

image

Notice that I used another such theme where the prompt is not on the same line as the extra info, but on its own line. While FZF is running here, we can hit ctrl-c to interrupt. If you do that very rapidly (ctrl-r, then ctrl-c and repeat), then at some point, you end up with this:

image

Theme

Any theme that has its prompt on its own line seems to make this.

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Version: 18.2.1

Shell: pwsh (7.2.13)

Segments:

ConsoleTitle(true)                         -   0 ms - sdesaulniers
root(false)                                -   0 ms - 
os(true)                                   -   1 ms -    
time(true)                                 -   0 ms - 17:51:40 
path(true)                                 -   1 ms -  ~ 
git(false)                                 -   4 ms - 
dotnet(false)                              -   0 ms - 
executiontime(false)                       -   0 ms - 
status(false)                              -   0 ms - 
text(true)                                 -   0 ms - ➜ 

Run duration: 36.3885ms

Cache path: C:\Users\sdesaulniers\AppData\Local\oh-my-posh

Config path: C:\Users\sdesaulniers\AppData\Local\Programs\oh-my-posh\themes\craver.omp.json

Logs:

[DEBUG] 17:51:40.067 shell.go:Getenv:387 → NO DATA
[TRACE] 17:51:40.067 shell.go:Getenv(TERM_PROGRAM) - 1.5076ms
[DEBUG] 17:51:40.067 shell.go:Getenv:387 → C:\Users\sdesaulniers\AppData\Local
[TRACE] 17:51:40.067 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 17:51:40.067 shell_windows.go:CachePath() - 0s
[DEBUG] 17:51:40.076 shell.go:Getenv:387 → C:\Users\sdesaulniers\AppData\Local\Programs\oh-my-posh\themes\craver.omp.json
[TRACE] 17:51:40.076 shell.go:Getenv(POSH_THEME) - 0s
[DEBUG] 17:51:40.077 shell.go:Shell:627 → no shell name provided in flags, trying to detect it
[DEBUG] 17:51:40.092 shell.go:Shell:635 → process name: pwsh.exe
[TRACE] 17:51:40.092 shell.go:Shell() - 16.0018ms
[TRACE] 17:51:40.092 shell.go:resolveConfigPath() - 16.0018ms
[TRACE] 17:51:40.092 shell.go:Init() - 26.5018ms
[TRACE] 17:51:40.092 shell.go:Flags() - 0s
[TRACE] 17:51:40.093 config.go:loadConfig() - 596.3µs
[TRACE] 17:51:40.093 shell.go:Flags() - 0s
[DEBUG] 17:51:40.093 shell.go:Getenv:387 → NO DATA
[TRACE] 17:51:40.093 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s
[TRACE] 17:51:40.093 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[DEBUG] 17:51:40.094 shell_windows.go:WindowsRegistryKeyValue:209 → ColorizationColor(DWORD): 0xC47A7574
[TRACE] 17:51:40.094 shell.go:Shell() - 0s
[DEBUG] 17:51:40.094 shell.go:Getenv:387 → 7.2.13
[TRACE] 17:51:40.094 shell.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 17:51:40.094 debug.go:PrintDebug:23 → Segment: Title
[TRACE] 17:51:40.094 shell_windows.go:Root() - 110.2µs
[TRACE] 17:51:40.094 shell.go:Shell() - 0s
[TRACE] 17:51:40.094 shell.go:StatusCodes() - 0s
[TRACE] 17:51:40.094 shell_windows.go:IsWsl() - 0s
[DEBUG] 17:51:40.094 shell.go:TemplateCache:805 → environment: [CONDA_PROMPT_MODIFIER=False POSH_AZURE_ENABLED=False POSH_CURSOR_COLUMN=1 POSH_CURSOR_LINE=1 POSH_GIT_ENABLED=False POSH_PID=71476 POSH_SHELL_VERSION=7.2.13 POSH_THEME=C:\Users\sdesaulniers\AppData\Local\Programs\oh-my-posh\themes\craver.omp.json POWERLINE_COMMAND=oh-my-posh __PSLockDownPolicy=0 ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\sdesaulniers\AppData\Roaming arl_naxmv=1 ChocolateyInstall=C:\ProgramData\chocolatey ChocolateyLastPathUpdate=133035222607457240 ChocolateyToolsLocation=C:\tools CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files 
ZES_ENABLE_SYSMAN=1]
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[DEBUG] 17:51:40.094 shell.go:Pwd:417 → C:\Users\sdesaulniers
[TRACE] 17:51:40.094 shell.go:Pwd() - 448.5µs
[DEBUG] 17:51:40.094 shell_windows.go:56 → C:\Users\sdesaulniers
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.094 shell.go:GOOS() - 0s
[TRACE] 17:51:40.095 shell.go:GOOS() - 0s
[TRACE] 17:51:40.095 shell.go:GOOS() - 0s
[TRACE] 17:51:40.095 shell.go:GOOS() - 0s
[TRACE] 17:51:40.095 shell.go:GOOS() - 0s
[TRACE] 17:51:40.095 shell.go:GOOS() - 0s
[TRACE] 17:51:40.095 shell.go:GOOS() - 0s
[DEBUG] 17:51:40.095 shell.go:User:538 → sdesaulniers
[TRACE] 17:51:40.095 shell.go:User() - 0s
[DEBUG] 17:51:40.095 shell.go:Host:550 → MTL-36116
[TRACE] 17:51:40.095 shell.go:Host() - 0s
[TRACE] 17:51:40.095 shell.go:GOOS() - 0s
[DEBUG] 17:51:40.095 shell.go:Getenv:387 → NO DATA
[TRACE] 17:51:40.095 shell.go:Getenv(SHLVL) - 0s
[TRACE] 17:51:40.095 shell.go:TemplateCache() - 705.6µs
[TRACE] 17:51:40.095 shell.go:Flags() - 0s
[DEBUG] 17:51:40.095 block.go:Debug:280 → Segment: root
[TRACE] 17:51:40.095 shell.go:Pwd() - 0s
[DEBUG] 17:51:40.095 shell_windows.go:56 → C:\Users\sdesaulniers
[TRACE] 17:51:40.095 shell.go:GOOS() - 0s
[TRACE] 17:51:40.095 shell_windows.go:Root() - 0s
[DEBUG] 17:51:40.095 block.go:Debug:280 → Segment: os
[TRACE] 17:51:40.095 shell.go:Pwd() - 0s
[DEBUG] 17:51:40.095 shell_windows.go:56 → C:\Users\sdesaulniers
[TRACE] 17:51:40.095 shell.go:GOOS() - 0s
[TRACE] 17:51:40.095 shell.go:GOOS() - 0s
[DEBUG] 17:51:40.095 properties.go:GetString:28 → 
[TRACE] 17:51:40.096 shell.go:TemplateCache() - 0s
[TRACE] 17:51:40.096 shell.go:TemplateCache() - 0s
[TRACE] 17:51:40.096 shell.go:Shell() - 0s
[DEBUG] 17:51:40.096 block.go:Debug:280 → Segment: time
[TRACE] 17:51:40.096 shell.go:Pwd() - 0s
[DEBUG] 17:51:40.096 shell_windows.go:56 → C:\Users\sdesaulniers
[TRACE] 17:51:40.096 shell.go:GOOS() - 0s
[DEBUG] 17:51:40.096 properties.go:GetString:28 → 15:04:05
[TRACE] 17:51:40.096 shell.go:TemplateCache() - 0s
[TRACE] 17:51:40.097 shell.go:TemplateCache() - 0s
[TRACE] 17:51:40.097 shell.go:Shell() - 0s
[DEBUG] 17:51:40.097 block.go:Debug:280 → Segment: path
[TRACE] 17:51:40.097 shell.go:Pwd() - 0s
[DEBUG] 17:51:40.097 shell_windows.go:56 → C:\Users\sdesaulniers
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:Pwd() - 0s
[TRACE] 17:51:40.097 shell.go:Shell() - 0s
[TRACE] 17:51:40.097 shell.go:Flags() - 0s
[DEBUG] 17:51:40.097 properties.go:GetBool:22 → mapped_locations_enabled: true
[DEBUG] 17:51:40.097 properties.go:GetString:28 → 
[DEBUG] 17:51:40.097 properties.go:GetString:28 → 
[DEBUG] 17:51:40.097 shell_windows.go:56 → C:\Users\sdesaulniers
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[DEBUG] 17:51:40.097 properties.go:GetString:28 → ~
[DEBUG] 17:51:40.097 properties.go:GetKeyValueMap:46 → mapped_locations: map[]
[TRACE] 17:51:40.097 shell.go:PathSeparator() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:PathSeparator() - 0s
[TRACE] 17:51:40.097 shell.go:PathSeparator() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:PathSeparator() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:PathSeparator() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:GOOS() - 0s
[TRACE] 17:51:40.097 shell.go:PathSeparator() - 0s
[TRACE] 17:51:40.097 shell.go:Pwd() - 0s
[TRACE] 17:51:40.097 shell_windows.go:IsWsl() - 0s
[TRACE] 17:51:40.097 shell.go:StackCount() - 0s
[DEBUG] 17:51:40.097 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 17:51:40.097 win32_windows.go:isWriteable:303 → current user is member of S-1-5-32-544
[DEBUG] 17:51:40.097 win32_windows.go:isWriteable:311 ↓
    WRITE_DAC
    WRITE_OWNER
    SYNCHRONIZE
    DELETE
    READ_CONTROL
[DEBUG] 17:51:40.097 win32_windows.go:isWriteable:313 → user has write access
[TRACE] 17:51:40.097 shell_windows.go:DirIsWritable() - 501.4µs
[TRACE] 17:51:40.097 shell.go:TemplateCache() - 0s
[TRACE] 17:51:40.097 shell.go:TemplateCache() - 0s
[TRACE] 17:51:40.097 shell.go:Shell() - 0s
[DEBUG] 17:51:40.098 block.go:Debug:280 → Segment: git
[TRACE] 17:51:40.098 shell.go:Pwd() - 0s
[DEBUG] 17:51:40.098 shell_windows.go:56 → C:\Users\sdesaulniers
[TRACE] 17:51:40.098 shell.go:GOOS() - 0s
[TRACE] 17:51:40.098 shell.go:GOOS() - 0s
[DEBUG] 17:51:40.102 shell.go:CommandPath:589 → C:\Program Files\Git\cmd\git.exe
[TRACE] 17:51:40.102 shell.go:CommandPath(git.exe) - 3.9995ms
[TRACE] 17:51:40.102 shell.go:HasCommand(git.exe) - 3.9995ms
[TRACE] 17:51:40.102 shell.go:Pwd() - 0s
[ERROR] 17:51:40.102 shell.go:HasParentFilePath:723 → CreateFile .git: The system cannot find the file specified.
[TRACE] 17:51:40.102 shell.go:HasParentFilePath(.git) - 500.3µs
[DEBUG] 17:51:40.102 properties.go:GetBool:22 → fetch_bare_info: false
[DEBUG] 17:51:40.102 block.go:Debug:280 → Segment: dotnet
[TRACE] 17:51:40.102 shell.go:Pwd() - 0s
[DEBUG] 17:51:40.102 shell_windows.go:56 → C:\Users\sdesaulniers
[TRACE] 17:51:40.102 shell.go:GOOS() - 0s
[DEBUG] 17:51:40.102 properties.go:GetStringArray:52 → extensions: [*.cs *.csx *.vb *.sln *.slnf *.csproj *.vbproj *.fs *.fsx *.fsproj global.json]
[DEBUG] 17:51:40.102 properties.go:GetStringArray:52 → folders: []
[DEBUG] 17:51:40.102 properties.go:GetBool:22 → home_enabled: false
[TRACE] 17:51:40.102 shell.go:Pwd() - 0s
[DEBUG] 17:51:40.102 shell_windows.go:56 → C:\Users\sdesaulniers
[DEBUG] 17:51:40.102 block.go:Debug:280 → Segment: executiontime
[TRACE] 17:51:40.102 shell.go:Pwd() - 0s
[DEBUG] 17:51:40.102 shell_windows.go:56 → C:\Users\sdesaulniers
[TRACE] 17:51:40.102 shell.go:GOOS() - 0s
[DEBUG] 17:51:40.102 properties.go:GetBool:22 → always_enabled: false
[TRACE] 17:51:40.102 shell.go:ExecutionTime() - 0s
[DEBUG] 17:51:40.102 properties.go:GetFloat64:34 → threshold: 1.000000
[DEBUG] 17:51:40.102 block.go:Debug:280 → Segment: status
[DEBUG] 17:51:40.102 properties.go:GetString:28 → {{ .Code }}
[TRACE] 17:51:40.102 shell.go:Pwd() - 0s
[DEBUG] 17:51:40.102 shell_windows.go:56 → C:\Users\sdesaulniers
[TRACE] 17:51:40.102 shell.go:GOOS() - 0s
[TRACE] 17:51:40.102 shell.go:StatusCodes() - 0s
[TRACE] 17:51:40.102 shell.go:TemplateCache() - 0s
[DEBUG] 17:51:40.102 properties.go:GetBool:22 → always_enabled: false
[TRACE] 17:51:40.102 shell.go:Flags() - 0s
[DEBUG] 17:51:40.102 block.go:Debug:280 → Segment: text
[TRACE] 17:51:40.102 shell.go:Pwd() - 0s
[DEBUG] 17:51:40.102 shell_windows.go:56 → C:\Users\sdesaulniers
[TRACE] 17:51:40.102 shell.go:GOOS() - 0s
[TRACE] 17:51:40.102 shell.go:TemplateCache() - 0s
[TRACE] 17:51:40.102 shell.go:Shell() - 0s
[DEBUG] 17:51:40.102 shell.go:Getenv:387 → C:\Users\sdesaulniers\AppData\Local
[TRACE] 17:51:40.102 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 17:51:40.102 shell_windows.go:CachePath() - 0s
[TRACE] 17:51:40.102 shell.go:Flags() - 0s
JanDeDobbeleer commented 1 year ago

Duplicate

sim590 commented 1 year ago

@JanDeDobbeleer : I'm sorry, I couldn't respond before you close. Should I assume that the bug was in oh-my-posh after all and that it is now fixed on the latest release?

JanDeDobbeleer commented 1 year ago

@sim590 no, this is a bug in the FZF or PSReadLine implementation. Not oh-my-posh.

github-actions[bot] commented 7 months ago

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.