JanDeDobbeleer / oh-my-posh

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

Transient Prompt has lingering text in output (line 2 bleeds into line 4?) #2911

Closed DEberhardt closed 2 years ago

DEberhardt commented 2 years ago

Code of Conduct

What happened?

I may not be able to describe this well, I think I am missing some vocabulary, but here it goes:

When I select multi-line text, like this one:

function Get-StrictMode {
  # returns the currently set StrictMode version 1, 2, 3
  # or 0 if StrictMode is off.
  try { $xyz = @(1); $null = ($null -eq $xyz[2]) }
  catch { return 3 }

  try { 'Not-a-Date'.Year }
  catch { return 2 }

  try { $null = ($undefined -gt 1) }
  catch { return 1 }

  return 0
}

and paste it into a session that has Oh-my-posh loaded with TransientPrompt enabled, the output is this:

[2022-10-08 15:48:44]❯ function Get-StrictMode {                                                                                                                                                                                                                                                                                                         >   # returns the currently set StrictMode version 1, 2, 3                                                                                                                                                                                                                                                                                               >   # or 0 if StrictMode is off.                                                                                                                                                                                                                                                                                                                         
>   try { $xyz = @(1); $null = ($null -eq $xyz[2]) }, 2, 3                                                                                                                                                                                                                                                                                               
>   catch { return 3 }de is off.
>   try { $xyz = @(1); $null = ($null -eq $xyz[2]) }
>   try { 'Not-a-Date'.Year }
>   catch { return 2 }
>   try { 'Not-a-Date'.Year }
>   try { $null = ($undefined -gt 1) }
>   catch { return 1 }
>   try { $null = ($undefined -gt 1) }
>   return 0return 1 }
> }

On line 4, the text "de is off." is repeated from line 2. I could observe this in other areas.

This has no impact on the execution, but is a visual bug on the terminal.

Theme

ParagnosterPlus2

{ "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", "blocks": [{ "alignment": "left", "segments": [{ "Enabled": false, "foreground": "#1BD760", "properties": { "paused_icon": "\uf8e3 ", "playing_icon": "\ue602 ", "stopped_icon": "\uf04d ", "track_separator": " - " }, "style": "plain", "template": "{{ .Icon }}{{ if ne .Status \"stopped\" }}{{ .Artist }} - {{ .Track }}{{ end }} ", "type": "spotify" }], "type": "prompt" }, { "alignment": "right", "segments": [{ "foreground": "#91ddff", "style": "plain", "template": " \uf85a {{ round .PhysicalPercentUsed .Precision }}% ", "type": "sysinfo" }, { "foreground_templates": [ "{{if eq \"Charging\" .State.String}}#40c4ff{{end}}", "{{if eq \"Discharging\" .State.String}}#ff5722{{end}}", "{{if eq \"Full\" .State.String}}#4caf50{{end}}" ], "foreground": "#f36943", "properties": { "charged_icon": "\uf583 ", "charging_icon": "\uf588 ", "discharging_icon": "\uf57d " }, "style": "plain", "template": " {{ if not .Error }}{{ .Icon }}{{ .Percentage }}{{ end }}{{ .Error }}% ", "type": "battery" }, { "type": "owm", "style": "plain", "foreground": "#91ddff", "template": "{{.Weather}} {{ .Temperature }}{{.UnitIcon }} ", "properties": { "apikey": "3d07cc3aeda66d90243a06c9f4deac5f", "location": "BRISTOL,GB", "units": "metric", "http_timeout": 100, "cache_timeout": 10 } }, { "foreground": "#ffffff", "properties": { "time_format": "_2 Jan" }, "style": "plain", "template": " {{ .CurrentDate | date .Format }}", "type": "time" }, { "foreground": "#91ddff", "properties": { "datetime_format": "2022-01-02 15:04:05", "time_format": "15:04:05" }, "style": "plain", "template": " {{ .CurrentDate | date .Format }}", "type": "time" } ], "type": "prompt" }, { "type": "newline" }, { "alignment": "left", "segments": [{ "Enabled": false, "background": "#ff8800", "foreground": "#100e23", "powerline_symbol": "\ue0c0", "properties": { "root_icon": "" }, "style": "powerline", "template": " \uf0e7 ", "type": "root" }, { "Enabled": false, "background": "#8800dd", "foreground": "#ffffff", "powerline_symbol": "\ue0b0", "properties": { "style": "amarillo", "threshold": 500 }, "style": "powerline", "template": " {{ .FormattedMs }} ", "type": "executiontime" }, { "background": "#ffffff", "foreground": "#100e23", "powerline_symbol": "\ue0b0", "style": "powerline", "template": " {{ .Name }} ", "type": "shell" }, { "Enabled": false, "background": "#91ddff", "foreground": "#100e23", "powerline_symbol": "\ue0b0", "properties": { "folder_icon": "\uf115", "folder_separator_icon": " \ue0b1 ", "style": "full" }, "style": "powerline", "template": " {{ .Path }} ", "type": "path" }, { "background": "#95ffa4", "background_templates": [ "{{ if or (.Working.Changed) (.Staging.Changed) }}#FF9248{{ end }}", "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#ff4500{{ end }}", "{{ if gt .Ahead 0 }}#B388FF{{ end }}", "{{ if gt .Behind 0 }}#B388FF{{ end }}" ], "foreground": "#193549", "leading_diamond": "\ue0b6", "powerline_symbol": "\ue0b0", "properties": { "branch_max_length": 25, "fetch_stash_count": true, "fetch_status": true, "fetch_upstream_icon": true }, "style": "powerline", "template": " {{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uf692 {{ .StashCount }}{{ end }} ", "trailing_diamond": "\ue0b4", "type": "git" }, { "Enabled": false, "background": "#906cff", "foreground": "#100e23", "powerline_symbol": "\ue0b0", "style": "powerline", "template": " \ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }} ", "type": "python" }, { "Enabled": false, "background": "#ff8080", "foreground": "#ffffff", "powerline_symbol": "\ue0b0", "style": "powerline", "template": " {{ if gt .Code 0 }}\uf00d {{ .Meaning }}{{ else }}\uf42e{{ end }} ", "type": "exit" } ], "type": "prompt" }, { "type": "newline" }, { "alignment": "left", "segments": [{ "Enabled": false, "foreground": "#007ACC", "style": "plain", "template": "\u276f ", "type": "text" }], "type": "prompt" } ], "transient_prompt": { "background": "transparent", "foreground": "#666666", "template": "[{{ .Segments.Time.CurrentDate | date \"2006-01-02 15:04:05\" }}]{{ if .Segments.Executiontime.Ms }}{{ if eq \"False\" (title (default \"False\" .Env.DISABLE_SEGMENT_TRANSIENT_EXEC_TIME)) }}[{{ .Segments.Executiontime.FormattedMs }}]{{ end }}{{ end }}\u276f " }, "version": 2 }

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Version: 12.0.1

Segments:

ConsoleTitle(false)  -   0 ms -
spotify(false)       -   1 ms -
sysinfo(true)        - 237 ms -   43%
battery(false)       -   1 ms -
owm(false)           - 107 ms -
time(true)           -   1 ms -   8 Oct
time(true)           -   6 ms -  15:59:08
root(false)          -   0 ms -
executiontime(false) -   0 ms -
shell(true)          -   1 ms -  powershell 
path(true)           -   0 ms -  C:\ 
git(false)           -   3 ms -
python(false)        -   0 ms -
exit(false)          -   0 ms -
text(true)           -   0 ms - ❯

Run duration: 383.3799ms

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

Config path: C:\Users\David\Documents\WindowsPowerShell\Scripts\ParagnosterPlus2.omp.json

Logs:

2022/10/08 15:59:08 debug: Getenv
C:\Users\David\AppData\Local
2022/10/08 15:59:08 Getenv duration: 0s, args: LOCALAPPDATA
2022/10/08 15:59:08 CachePath duration: 0s, args:
2022/10/08 15:59:08 debug: Getenv
C:\Users\David\Documents\WindowsPowerShell\Scripts\ParagnosterPlus2.omp.json
2022/10/08 15:59:08 Getenv duration: 0s, args: POSH_THEME
2022/10/08 15:59:08 debug: Shell
process name: powershell.exe
2022/10/08 15:59:08 Shell duration: 16.7002ms, args:
2022/10/08 15:59:08 resolveConfigPath duration: 16.7002ms, args:
2022/10/08 15:59:08 Init duration: 17.6967ms, args:
2022/10/08 15:59:08 Flags duration: 0s, args:
2022/10/08 15:59:08 config.loadConfig duration: 1.1467ms, args:
2022/10/08 15:59:08 Flags duration: 0s, args:
2022/10/08 15:59:08 debug: Getenv

2022/10/08 15:59:08 Getenv duration: 0s, args: OMP_CACHE_DISABLED
2022/10/08 15:59:08 WindowsRegistryKeyValue duration: 0s, args: HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 debug: WindowsRegistryKeyValue
ColorizationColor(DWORD): 0xC40078D4
2022/10/08 15:59:08 Root duration: 0s, args:
2022/10/08 15:59:08 Shell duration: 0s, args:
2022/10/08 15:59:08 ErrorCode duration: 0s, args:
2022/10/08 15:59:08 IsWsl duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 debug: User
David
2022/10/08 15:59:08 User duration: 0s, args:
2022/10/08 15:59:08 debug: Host
COMPLEX
2022/10/08 15:59:08 Host duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 TemplateCache duration: 506.4µs, args:
2022/10/08 15:59:08 Flags duration: 0s, args:
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 WindowTitle duration: 1.6232ms, args: ^(Spotify.*)|(.*\s-\s.*)$
2022/10/08 15:59:08 Flags duration: 0s, args:
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 TemplateCache duration: 0s, args:
2022/10/08 15:59:08 TemplateCache duration: 0s, args:
2022/10/08 15:59:08 Shell duration: 0s, args:
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 IsWsl duration: 0s, args:
2022/10/08 15:59:08 error: BatteryState
no battery
2022/10/08 15:59:08 BatteryState duration: 1.6852ms, args:
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 debug: HTTPRequest
GET /data/2.5/weather?q=BRISTOL,GB&units=metric&appid=3d07cc3aeda66d90243a06c9f4deac5f HTTP/1.1
Host: api.openweathermap.org
User-Agent: Go-http-client/1.1
Accept-Encoding: gzip

2022/10/08 15:59:08 error: HTTPRequest
Get "http://api.openweathermap.org/data/2.5/weather?q=BRISTOL,GB&units=metric&appid=3d07cc3aeda66d90243a06c9f4deac5f": context deadline exceeded
2022/10/08 15:59:08 HTTPRequest duration: 107.8302ms, args: http://api.openweathermap.org/data/2.5/weather?q=BRISTOL,GB&units=metric&appid=3d07cc3aeda66d90243a06c9f4deac5f
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 TemplateCache duration: 0s, args:
2022/10/08 15:59:08 TemplateCache duration: 0s, args:
2022/10/08 15:59:08 Shell duration: 0s, args:
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 TemplateCache duration: 0s, args:
2022/10/08 15:59:08 TemplateCache duration: 0s, args:
2022/10/08 15:59:08 Shell duration: 0s, args:
2022/10/08 15:59:08 Flags duration: 0s, args:
2022/10/08 15:59:08 Flags duration: 0s, args:
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 Root duration: 130.7µs, args:
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 ExecutionTime duration: 0s, args:
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 Shell duration: 0s, args:
2022/10/08 15:59:08 Flags duration: 0s, args:
2022/10/08 15:59:08 TemplateCache duration: 0s, args:
2022/10/08 15:59:08 TemplateCache duration: 0s, args:
2022/10/08 15:59:08 Shell duration: 0s, args:
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 Shell duration: 0s, args:
2022/10/08 15:59:08 Shell duration: 0s, args:
2022/10/08 15:59:08 Flags duration: 0s, args:
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 PathSeparator duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 PathSeparator duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 PathSeparator duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 PathSeparator duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 PathSeparator duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 PathSeparator duration: 0s, args:
2022/10/08 15:59:08 IsWsl duration: 0s, args:
2022/10/08 15:59:08 StackCount duration: 0s, args:
2022/10/08 15:59:08 DirIsWritable duration: 219.5µs, args:
2022/10/08 15:59:08 TemplateCache duration: 0s, args:
2022/10/08 15:59:08 TemplateCache duration: 0s, args:
2022/10/08 15:59:08 Shell duration: 0s, args:
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 debug: CommandPath
C:\Program Files\Git\cmd\git.exe
2022/10/08 15:59:08 CommandPath duration: 3.8381ms, args: git.exe
2022/10/08 15:59:08 HasCommand duration: 3.8381ms, args: git.exe
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 error: HasParentFilePath
CreateFile C:\.git: The system cannot find the file specified.
2022/10/08 15:59:08 HasParentFilePath duration: 0s, args: .git
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 debug: Getenv

2022/10/08 15:59:08 Getenv duration: 0s, args: VIRTUAL_ENV
2022/10/08 15:59:08 debug: Getenv

2022/10/08 15:59:08 Getenv duration: 0s, args: CONDA_ENV_PATH
2022/10/08 15:59:08 debug: Getenv

2022/10/08 15:59:08 Getenv duration: 0s, args: CONDA_DEFAULT_ENV
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 ErrorCode duration: 0s, args:
2022/10/08 15:59:08 ErrorCode duration: 0s, args:
2022/10/08 15:59:08 Flags duration: 0s, args:
2022/10/08 15:59:08 Flags duration: 0s, args:
2022/10/08 15:59:08 debug: Pwd
C:\
2022/10/08 15:59:08 Pwd duration: 0s, args:
2022/10/08 15:59:08 debug: Home
C:\Users\David
2022/10/08 15:59:08 GOOS duration: 0s, args:
2022/10/08 15:59:08 TemplateCache duration: 0s, args:
2022/10/08 15:59:08 TemplateCache duration: 0s, args:
2022/10/08 15:59:08 Shell duration: 0s, args:
2022/10/08 15:59:08 debug: Getenv
C:\Users\David\AppData\Local
2022/10/08 15:59:08 Getenv duration: 0s, args: LOCALAPPDATA
2022/10/08 15:59:08 CachePath duration: 0s, args:
2022/10/08 15:59:08 Flags duration: 0s, args:
JanDeDobbeleer commented 2 years ago

@DEberhardt this is a PSReadline bug. We set the prompt line count correctly, but somehow this use-case isn't yet well supported.

DEberhardt commented 2 years ago

ah - PsReadLine again - I shall report there :smile:

JanDeDobbeleer commented 2 years ago

@DEberhardt it's a core functionality in PowerShell. Do let me know if there's something I can do. All of this isn't very well documented yet.

adthom commented 1 year ago

Not to resurrect an old thread, but since no progress has been made on the PSReadline issue, I devised a workaround if you are running into issues with this. If you adjust the transient prompt behavior to also ensure the commandline is shorter than the current buffer, you can prevent this issue. You can test this locally with this:

Set-PSReadLineKeyHandler -Key Enter -BriefDescription 'OhMyPoshEnterKeyHandlerCleaned' -ScriptBlock {
    $previousOutputEncoding = [Console]::OutputEncoding
    try {
        $parseErrors = $null
        $currentAst = $null
        [Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$currentAst, [ref]$null, [ref]$parseErrors, [ref]$null)
        if ($parseErrors.Count -eq 0) {
            # get number of lines in the current commandline
            $lines = $currentAst.Extent.Text.Split("`n").Count
            # get buffer height
            $terminalHeight = $Host.UI.RawUI.WindowSize.Height
            # only render transient prompt if the commandline fits in the buffer
            if ($lines -le $terminalHeight -and $terminalHeight -gt 0) {
                # HACK for debugging
                if ($null -ne ($omp = Get-Module oh-my-posh-core -ErrorAction SilentlyContinue)) { & $omp { $script:TransientPrompt = $true } }
                # ENDHACK
                # $script:TransientPrompt = $true
                [Console]::OutputEncoding = [Text.Encoding]::UTF8
                [Microsoft.PowerShell.PSConsoleReadLine]::EndOfLine
                [Microsoft.PowerShell.PSConsoleReadLine]::InvokePrompt()
            }
        }
    }
    finally {
        # If PSReadline is set to display suggestion list, this workaround is needed to clear the buffer below
        # before accepting the current commandline. The max amount of items in the list is 10, so 12 lines
        # are cleared (10 + 1 more for the prompt + 1 more for current commandline).
        if ((Get-PSReadLineOption).PredictionViewStyle -eq 'ListView') {
            $terminalHeight = $Host.UI.RawUI.WindowSize.Height
            # only do this on an valid value
            if ([int]$terminalHeight -gt 0) {
                [Microsoft.PowerShell.PSConsoleReadLine]::Insert("`n" * [System.Math]::Min($terminalHeight - $Host.UI.RawUI.CursorPosition.Y - 1, 12))
                [Microsoft.PowerShell.PSConsoleReadLine]::Undo()
            }
        }
        [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()
        [Console]::OutputEncoding = $previousOutputEncoding
    }
}

This will make these larger entries not update to your transient prompt, but since they are already scrolled off the visible window, the space-savings of your transient prompt are less impactful. Obviously being able to adjust the prompt from a prior entry would be optimal, but in the interim, this allows you to continue to use large code blocks without erroring.

github-actions[bot] commented 10 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.