Typing on Stale Windows Terminal Powershell Adds a new line and executes the same command #17287

Closed
opened 2026-01-31 05:37:51 +00:00 by claunia · 9 comments
Owner

Originally created by @MS-Manikandan on GitHub (Apr 20, 2022).

Windows Terminal version

1.12.1073

Windows build number

10.0.19044.0

Other Software

No response

Steps to reproduce

When the Terminal is left unused for a while (around 10-20 mins for me), then executing any command executed on a new line.This happened when I upgraded to V 1.12.1073 from V1.11.3471.0. Even though when I manually downgrade to version-1.11.3471.0 its updates to the latest version automatically.
WindowsTerminalBug-1 12 1073-2
WindowsTerminalBug-1 12 1073-1

Expected Behavior

When any command is executed in the terminal when its stale it shouldn't add a new line and execute the same command.

Actual Behavior

When any command is executed in the terminal when its stale it adds a new line and execute the same command.

Originally created by @MS-Manikandan on GitHub (Apr 20, 2022). ### Windows Terminal version 1.12.1073 ### Windows build number 10.0.19044.0 ### Other Software _No response_ ### Steps to reproduce When the Terminal is left unused for a while (around 10-20 mins for me), then executing any command executed on a new line.This happened when I upgraded to V 1.12.1073 from V1.11.3471.0. Even though when I manually downgrade to version-1.11.3471.0 its updates to the latest version automatically. ![WindowsTerminalBug-1 12 1073-2](https://user-images.githubusercontent.com/42301172/164191971-45f365dc-fc1e-47e6-ae88-8de1b0def1e8.gif) ![WindowsTerminalBug-1 12 1073-1](https://user-images.githubusercontent.com/42301172/164191984-217affc8-ceaa-45ef-91ed-7966bcb59917.gif) ### Expected Behavior When any command is executed in the terminal when its stale it shouldn't add a new line and execute the same command. ### Actual Behavior When any command is executed in the terminal when its stale it adds a new line and execute the same command.
Author
Owner

@zadjii-msft commented on GitHub (Apr 20, 2022):

Which shell are you using/? How have you customized the shell? Any chance you resized the window in this time? There's the ever so smallest bit of scrollbar visible which makes it look like the viewport might have started at the top of the screen, but is now scrolled down one line...

@zadjii-msft commented on GitHub (Apr 20, 2022): Which shell are you using/? How have you customized the shell? Any chance you resized the window in this time? There's the ever so smallest bit of scrollbar visible which makes it look like the viewport might have started at the top of the screen, but is now scrolled down one line...
Author
Owner

@MS-Manikandan commented on GitHub (Apr 20, 2022):

It's an customized shell, I am using oh-my-posh with powershell 5.1, I haven't resized the window to smallest, it scrolled down one line automatically when there's more than 2 chars of the command executed.

@MS-Manikandan commented on GitHub (Apr 20, 2022): It's an customized shell, I am using oh-my-posh with powershell 5.1, I haven't resized the window to smallest, it scrolled down one line automatically when there's more than 2 chars of the command executed.
Author
Owner

@zadjii-msft commented on GitHub (Apr 20, 2022):

Can you share your powershell profile/? That might help us get a better read on what's causing this.

@zadjii-msft commented on GitHub (Apr 20, 2022): Can you share your powershell profile/? That might help us get a better read on what's causing this.
Author
Owner

@MS-Manikandan commented on GitHub (Apr 20, 2022):

Import-Module posh-git
Import-Module oh-my-posh
Set-Theme paradox
if ($host.Name -eq 'ConsoleHost')
{
    Import-Module PSReadLine
}

Set-PSReadLineKeyHandler -Key Ctrl+Shift+b `
                         -BriefDescription BuildCurrentDirectory `
                         -LongDescription "Build the current directory" `
                         -ScriptBlock {
    [Microsoft.PowerShell.PSConsoleReadLine]::RevertLine()
    [Microsoft.PowerShell.PSConsoleReadLine]::Insert("dotnet build")
    [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()
}
 Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
@MS-Manikandan commented on GitHub (Apr 20, 2022): ```pwsh Import-Module posh-git Import-Module oh-my-posh Set-Theme paradox if ($host.Name -eq 'ConsoleHost') { Import-Module PSReadLine } Set-PSReadLineKeyHandler -Key Ctrl+Shift+b ` -BriefDescription BuildCurrentDirectory ` -LongDescription "Build the current directory" ` -ScriptBlock { [Microsoft.PowerShell.PSConsoleReadLine]::RevertLine() [Microsoft.PowerShell.PSConsoleReadLine]::Insert("dotnet build") [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine() } Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward ```
Author
Owner

@zadjii-msft commented on GitHub (Apr 20, 2022):

oh here's another thought - Have you ran any commands since opening the split pane/? I'm guessing that the pane opening "resized" the control once, and that left the cursor misaligned. If my theory is right, subsequent commands should work just fine.

This might be another version of #2432. If it is, you might be able to install the latest PsReadline beta which apparently has a fix for that bug in it.

@zadjii-msft commented on GitHub (Apr 20, 2022): oh here's another thought - Have you ran _any_ commands since opening the split pane/? I'm guessing that the pane opening "resized" the control once, and that left the cursor misaligned. If my theory is right, subsequent commands should work just fine. This might be another version of #2432. If it is, you might be able to install the latest PsReadline beta which apparently has a fix for that bug in it.
Author
Owner

@MS-Manikandan commented on GitHub (Apr 20, 2022):

@zadjii-msft, I haven't ran any commands in split pane, It started to happen after updating to version 1.12.1073, and I am not sure does updating to latest PsReadline beta solves this.

@MS-Manikandan commented on GitHub (Apr 20, 2022): @zadjii-msft, I haven't ran any commands in split pane, It started to happen after updating to version 1.12.1073, and I am not sure does updating to latest PsReadline beta solves this.
Author
Owner

@zadjii-msft commented on GitHub (Aug 15, 2022):

Hey sorry for the delay. It's not clear to me from your reply - did installing the latest PsReadline beta version (anything greater than v2.2.0-beta5) help here/?

@zadjii-msft commented on GitHub (Aug 15, 2022): Hey sorry for the delay. It's not clear to me from your reply - did installing the latest PsReadline beta version (anything greater than `v2.2.0-beta5`) help here/?
Author
Owner

@MS-Manikandan commented on GitHub (Aug 18, 2022):

I currently use PSReadLine version 2.2.6 , windows terminal version 1.14.~, since I have updated both to these versions i don't face this issue.

@MS-Manikandan commented on GitHub (Aug 18, 2022): I currently use PSReadLine version 2.2.6 , windows terminal version 1.14.~, since I have updated both to these versions i don't face this issue.
Author
Owner

@zadjii-msft commented on GitHub (Aug 18, 2022):

Neato, thanks for the follow up!

@zadjii-msft commented on GitHub (Aug 18, 2022): Neato, thanks for the follow up!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17287