microsoft / microsoft/terminal

Intermittently unable to exit pager after `git log`

Open
#16,748 7 comments 2 reactions 1 assignee View on GitHub

@lhecker is already working on this.

Since Mar 6, 2024.

Area-Input Issue-Bug Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.