microsoft / microsoft/terminal
Scrollback commands conflict with common editing shortcuts
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
Description
### Description of the new feature
Windows Terminal version: **1.24.260303001**
Some scrollback commands are conflicting with common editing shortcuts.
It would be nice if these could be disabled dynamically / automatically.
**Description:**
When an application activates an alternate buffer the windows terminal should probably not handle scrollback commands.
There are two good reasons for that:
- alternate buffers usually cover a single screen
- these combinations are commonly used when editing text
These are the most problematic ones:
```
// Scrollback
{ "keys": "ctrl+shift+pgdn", "id": "Terminal.ScrollDownPage" },
{ "keys": "ctrl+shift+pgup", "id": "Terminal.ScrollUpPage" },
{ "keys": "ctrl+shift+home", "id": "Terminal.ScrollToTop" },
{ "keys": "ctrl+shift+end", "id": "Terminal.ScrollToBottom" },
{ "keys": "ctrl+shift+k", "id": "Terminal.ClearBuffer" },
```
`ctrl+shift+k` / `Terminal.ClearBuffer` is (to my knowledge) not commonly used, but if pressed would really mess up an application using an alternate screen, as all but the line with the caret gets erased.
**The commands are described here:**
https://learn.microsoft.com/en-us/windows/terminal/customize-settings/actions#scrollback-commands
https://github.com/microsoft/terminal/blob/main/src/cascadia/TerminalSettingsModel/defaults.json
### Proposed technical implementation details
**Proposed change:**
- if an alternate screen is active and a child app is still running, these should be sent to the application
**Alternate solution:**
- an app could send an SGR / ANSI ESC sequence to deactivate these
Contributor guide
Research direction
Start with the scrollback action definitions in src/cascadia/TerminalSettingsModel/defaults.json and the linked scrollback-command documentation. Trace how these commands are handled when an alternate screen is active while a child application is running. Done means the listed commands are passed to that application in that state while retaining their scrollback behavior otherwise.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100