Intermittently unable to exit pager after git log #21288

Open
opened 2026-01-31 07:38:46 +00:00 by claunia · 6 comments
Owner

Originally created by @karkianish on GitHub (Feb 22, 2024).

Originally assigned to: @lhecker on GitHub.

Windows Terminal version

1.19.240130002

Windows build number

10.0.22631.0

Other Software

No response

Steps to reproduce

  • create a git repo
  • make about 50 commits so the git log needs to use pager
    mkdir winterm-pager-repro; cd winterm-pager-repro; invoke-expression 'git init'; for($i = 0; $i -le 50; $i++) { echo 'abc' >> testfile.txt; invoke-expression 'git add .'; invoke-expression "git commit -m "test commit $i"'; }
  • run 'git log' on the repo. make sure the pager is invoked and you have an option to enter q to exit pager and get back to prompt. please try this 10-15 times. this doesnt happen consistently but its happens consistently when tried multiple times.
  • if reproed, after entering 'q', the ':' at the end of page disappears, cursor continues to blink, but prompt wont be available. you will need to open a new tab or instance to continue.

Expected Behavior

upon hitting 'q', pager should exit and I should be back on the command prompt.

Actual Behavior

upon hitting 'q' to exit pager, command prompt doesn't reappear. only option is to open a new tab/instance.

in the image below, I should be able to hit q and get back to the prompt
winterm-cursor-issue-1

when i hit 'q', the terminal gets stuck. there cursor continues to blink (not captured in screenshot below) but terminal doesnt respond to any key press. it is not frozen because i can select text with my mouse, close/open new tabs.
image

Few things I have tried to isolate the issue:

  • ran powershell without my profile and without loading any other module besides ps-readline, the issue still happens
Originally created by @karkianish on GitHub (Feb 22, 2024). Originally assigned to: @lhecker on GitHub. ### Windows Terminal version 1.19.240130002 ### Windows build number 10.0.22631.0 ### Other Software _No response_ ### Steps to reproduce - create a git repo - make about 50 commits so the git log needs to use pager `mkdir winterm-pager-repro; cd winterm-pager-repro; invoke-expression 'git init'; for($i = 0; $i -le 50; $i++) { echo 'abc' >> testfile.txt; invoke-expression 'git add .'; invoke-expression "git commit -m "test commit $i"'; } ` - run 'git log' on the repo. make sure the pager is invoked and you have an option to enter `q` to exit pager and get back to prompt. please try this 10-15 times. this doesnt happen consistently but its happens consistently when tried multiple times. - if reproed, after entering 'q', the ':' at the end of page disappears, cursor continues to blink, but prompt wont be available. you will need to open a new tab or instance to continue. ### Expected Behavior upon hitting 'q', pager should exit and I should be back on the command prompt. ### Actual Behavior upon hitting 'q' to exit pager, command prompt doesn't reappear. only option is to open a new tab/instance. in the image below, I should be able to hit q and get back to the prompt ![winterm-cursor-issue-1](https://github.com/microsoft/terminal/assets/375884/633231e0-3d20-413a-8dd6-29e1301ccbf7) when i hit 'q', the terminal gets stuck. there cursor continues to blink (not captured in screenshot below) but terminal doesnt respond to any key press. it is not frozen because i can select text with my mouse, close/open new tabs. ![image](https://github.com/microsoft/terminal/assets/375884/664c1471-6a07-45e4-b5ad-71c7d3298773) Few things I have tried to isolate the issue: - ran powershell without my profile and without loading any other module besides ps-readline, the issue still happens
claunia added the Issue-BugArea-InputProduct-Terminal labels 2026-01-31 07:38:47 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Mar 6, 2024):

#14288 sounds familiar, but we thought we fixed that a while back. Weird. Are you resizing at all in that process?

@zadjii-msft commented on GitHub (Mar 6, 2024): #14288 sounds familiar, but we thought we fixed that a while back. Weird. Are you resizing at all in that process?
Author
Owner

@bobomb commented on GitHub (Apr 16, 2024):

I have this issue happen to me often multiple times per day, and it's not just git log, but also git diff when it uses the pager. For the longest time I've suspected it might be a bug with Clink and Terminals used together, but I don't have any evidence to point to it conclusively. If this issue occurs, would a process dump of Terminals and/or Git and the pager (less) have any value to help debug it?

@bobomb commented on GitHub (Apr 16, 2024): I have this issue happen to me often multiple times per day, and it's not just git log, but also git diff when it uses the pager. For the longest time I've suspected it might be a bug with Clink and Terminals used together, but I don't have any evidence to point to it conclusively. If this issue occurs, would a process dump of Terminals and/or Git and the pager (less) have any value to help debug it?
Author
Owner

@alberto-ingenito commented on GitHub (Jul 4, 2024):

I got same problems. Any update on this?

@alberto-ingenito commented on GitHub (Jul 4, 2024): I got same problems. Any update on this?
Author
Owner

@dc0sic commented on GitHub (Jan 2, 2025):

I have the same problem (on Windows 11 Pro). The pager freezes frequently and it does so regardless of whether I use bash (the one that comes with git or the one that's part of VS Code), PowerShell, or Windows command line. So far, I haven't observed this behavior outside of git. For example, less long_file works fine and doesn't hang when it reaches the end.

@dc0sic commented on GitHub (Jan 2, 2025): I have the same problem (on Windows 11 Pro). The pager freezes frequently and it does so regardless of whether I use bash (the one that comes with git or the one that's part of VS Code), PowerShell, or Windows command line. So far, I haven't observed this behavior outside of git. For example, `less long_file` works fine and doesn't hang when it reaches the end.
Author
Owner

@ryanmda commented on GitHub (Apr 15, 2025):

I've certainly run into this, though I would just as easily suspect a bug with the windows build of the pager. I don't notice the issue if I'm using git with pager in WSL

@ryanmda commented on GitHub (Apr 15, 2025): I've certainly run into this, though I would just as easily suspect a bug with the windows build of the pager. I don't notice the issue if I'm using git with pager in WSL
Author
Owner

@JP-RD commented on GitHub (Oct 23, 2025):

I started experiencing this bug recently with the Git Bash shell not Powershell, after having no issue since I installed Windows terminal. I coincided with changing these settings in my advanced settings:

  1. Experimental: reposition the cursor with mouse clicks
  2. Display menu on right-click

I turned them both off and the problem went away.

I turned back on "Experimental: reposition the cursor with mouse clicks" and the issue came back.

I ran the same experiment with Powershell and was able to reproduce the issue and the fix so it seems as if "Experimental: reposition the cursor with mouse clicks" is a problem but I don't know if it is the only problem that causes this issue.

@JP-RD commented on GitHub (Oct 23, 2025): I started experiencing this bug recently with the Git Bash shell not Powershell, after having no issue since I installed Windows terminal. I coincided with changing these settings in my advanced settings: 1. Experimental: reposition the cursor with mouse clicks 2. Display menu on right-click I turned them both off and the problem went away. I turned back on "Experimental: reposition the cursor with mouse clicks" and the issue came back. I ran the same experiment with Powershell and was able to reproduce the issue and the fix so it seems as if "Experimental: reposition the cursor with mouse clicks" is a problem but I don't know if it is the only problem that causes this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21288