Resizing unix shells with Windows Terminal doesn't clear the previous prompt, spamming up the shell and eventually crashing windows terminal. #403
-
Prerequisites
DescriptionResizing unix shells via WSL or Windows OpenSSH doesn't clear the previous prompt, spamming up the shell and eventually crashing windows terminal. HQ version: https://giant.gfycat.com/MiniatureThinGreatdane.webm Environment
Steps to Reproduce
Expected behavior: no crash, and also it should clear the prompt. Actual behavior: it doesn't clear the prompt, and then crashes the terminal. |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
@AskAlice I understand the issue, but how is that the responsibility of the prompt generator? Oh my Posh hooks into the shell's prompt function (depends on the platform). Clearing also implies clearing the screen which is maybe not what the user wants (clearing a line is weird as you don't even know where the cursor is at that point in time). Maybe I'm not aware of something but I don't see how we can do this without opening another jar of impossible to resolve issues. |
Beta Was this translation helpful? Give feedback.
-
@AskAlice I found this issue, which seems pretty close to what you're experiencing. For what it's worth, I tried to reproduce this using iTerm2 on Mac and I can't make the app crash when reproducing this. |
Beta Was this translation helpful? Give feedback.
-
That's right. The terminal isn't supposed to crash because of a prompt. Looking at the issue linked, This seems to be an issue with the headless Console Host that powers the Windows Terminal |
Beta Was this translation helpful? Give feedback.
-
I went to make this issue because of the spamming of the prompt, and found it also happened to crash the terminal when done for long enough |
Beta Was this translation helpful? Give feedback.
-
If i use p10k with .oh-my-zsh it doesn't spam like this, so it's somehow possible within this repo to fix that, not quite sure where to start, though. They have this special prompt that doesn't show previous prompts after you hit enter, just an arrow then what you wrote in the prompt, then the output, and eventually the current (and only visible) prompt. |
Beta Was this translation helpful? Give feedback.
-
@AskAlice I also use zsh and the prompt is't being spammed in resize. Somehow it feels like Windows Terminal is doing some voodoo magic underneath. p10k leverages zsh directly, something we can't do (other than the init script). There is also more information to be found in other repos that talks directly about similar behaviour caused by |
Beta Was this translation helpful? Give feedback.
-
Alright feel free to close if that's the case |
Beta Was this translation helpful? Give feedback.
-
@AskAlice maybe there's a solution in those issues we can implement in the zsh setup. I'll have to read through it more closely. |
Beta Was this translation helpful? Give feedback.
-
@AskAlice a solution would be to disable wrap on resize in the terminal, however, the Windows Terminal team decided against adding the functionality (lord knows why). |
Beta Was this translation helpful? Give feedback.
@AskAlice I also use zsh and the prompt is't being spammed in resize. Somehow it feels like Windows Terminal is doing some voodoo magic underneath. p10k leverages zsh directly, something we can't do (other than the init script). There is also more information to be found in other repos that talks directly about similar behaviour caused by
RPROMPT
. Coming back to the root cause of the issue, namely that your prompt is being replicated (zsh issue) and that the terminal crashes (windows terminal issue) 😅