Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PageUp / PageDown keys do not reach tmux #148685

Closed
magdumnikhil opened this issue May 4, 2022 · 7 comments
Closed

PageUp / PageDown keys do not reach tmux #148685

magdumnikhil opened this issue May 4, 2022 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug terminal-input Relating to typing in the terminal not doing the right thing, IMEs not working, etc. upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-fixed The underlying upstream issue has been fixed upstream-issue-linked This is an upstream issue that has been reported upstream verified Verification succeeded
Milestone

Comments

@magdumnikhil
Copy link

Issue Type: Bug

Configure tmux to cycle through windows with key "Ctrl + PageUp", "Ctrl + PageDown"

bind -n C-PgDn prev
bind -n C-PgUp next

Launch tmux, create multiple windows
Issue the above key-combinations

Output: Nothing happens with Ctrl + PageUp. Ctrl-PageDown just prints the "~" character on the terminal.

Any default/user-defined keyboard shortcuts involving PageUp/PageDown related to the terminal are removed.

settings and keybindings are attached

The keyboard is set to "US QWERTY"

VS Code version: Code 1.66.2 (dfd34e8, 2022-04-11T07:46:01.075Z)
OS version: Windows_NT x64 10.0.22000
Restricted Mode: No
Remote OS version: Linux x64 5.4.0-107-generic

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz (16 x 2496)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.73GB (20.21GB free)
Process Argv --crash-reporter-id 85c323a1-5d98-45e5-8818-74519d9e3b95
Screen Reader no
VM 0%
Item Value
Remote SSH: 10.40.199.111
OS Linux x64 5.4.0-107-generic
CPUs Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz (4 x 3600)
Memory (System) 62.70GB (7.58GB free)
VM 0%
Extensions (18)
Extension Author (truncated) Version
project-manager ale 12.5.0
docs-view bie 0.0.10
arm dan 1.7.4
remote-ssh ms- 0.78.0
remote-ssh-edit ms- 0.80.0
remote-wsl ms- 0.66.2
linkerscript Zix 1.0.2
atlascode atl 2.10.12
codealignment-vscode cpm 2.0.19
doxdocgen csc 1.4.0
gitlens eam 12.0.6
todo-tree Gru 0.0.215
cpptools ms- 1.9.8
hexeditor ms- 1.9.6
vscode-commons red 0.0.6
vscode-xml red 0.20.0
vscode-yaml red 1.7.0
tmlanguage Tog 0.9.0

(1 theme extension excluded)

A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonvspyt551cf:30345471
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
pythonvsnew555:30457759
vscscmwlcmt:30465135
cppdebugcf:30475217

settings.txt
keybindings.txt

@Tyriar
Copy link
Member

Tyriar commented May 4, 2022

With these keybindings:

{ "key": "ctrl+pagedown",         "command": "-workbench.action.nextEditor" },
{ "key": "ctrl+pageup",           "command": "-workbench.action.previousEditor" },
{ "key": "ctrl+pagedown",         "command": "-workbench.action.terminal.focusNext",
    "when": "terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus" },
{ "key": "ctrl+pageup",           "command": "-workbench.action.terminal.focusPrevious",
    "when": "terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus" },

ctrl+pageup/pagedown do get sent to the shell, but end up getting send using the same sequence as without ctrl.

pageup:        xterm.js: sending data "�[5~" (4) [27, 91, 53, 126]
ctrl+pageup:   xterm.js: sending data "�[5~" (4) [27, 91, 53, 126]
pagedown:      xterm.js: sending data "�[6~" (4) [27, 91, 54, 126]
ctrl+pagedown: xterm.js: sending data "�[6~" (4) [27, 91, 54, 126]

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug upstream Issue identified as 'upstream' component related (exists outside of VS Code) terminal-input Relating to typing in the terminal not doing the right thing, IMEs not working, etc. labels May 4, 2022
@Tyriar Tyriar added this to the Backlog milestone May 4, 2022
@magdumnikhil
Copy link
Author

Is any workaround available?

@Tyriar
Copy link
Member

Tyriar commented May 5, 2022

Yes, you can use workbench.action.terminal.sendSequence to send whatever you want, example keybinding:

{ "key": "ctrl+backspace",
  "command": "workbench.action.terminal.sendSequence",
  "when": "terminalFocus",
  "args": {"text":"\u0017"} }

You'd need to figure out the right sequence to send though, I'm not sure currently.

@magdumnikhil
Copy link
Author

Thanks for the suggestion. The following entries in the keybindings.json helped.

{
	"key": "ctrl+pageup",
	"command": "workbench.action.terminal.sendSequence",
	"args": { "text": "\u001b\u005b\u0035\u003b\u0035\u007e"},
	"when": "terminalFocus"
},
{
	"key": "ctrl+pagedown",
	"command": "workbench.action.terminal.sendSequence",
	"args": { "text": "\u001b\u005b\u0036\u003b\u0035\u007e"},
	"when": "terminalFocus"
}

In case anyone else lands here, the following is the pyhon3 code to get the sequence

key = input()

print("".join("\\u{:04x}".format(ord(k)) for k in key))

@Tyriar
Copy link
Member

Tyriar commented May 6, 2022

Thanks for looking up the sequence, I put a fix out upstream xtermjs/xterm.js#3761

@Tyriar Tyriar modified the milestones: Backlog, May 2022 May 6, 2022
@Tyriar Tyriar added upstream-issue-linked This is an upstream issue that has been reported upstream upstream-issue-fixed The underlying upstream issue has been fixed labels May 6, 2022
@Tyriar Tyriar closed this as completed May 6, 2022
@Tyriar
Copy link
Member

Tyriar commented May 6, 2022

Fixed via #148923

@roblourens
Copy link
Member

I was trying to set this up in iTerm at first to compare, but was confused because it just doesn't work in iTerm 😁 works great in vscode

@roblourens roblourens added the verified Verification succeeded label Jun 3, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug terminal-input Relating to typing in the terminal not doing the right thing, IMEs not working, etc. upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-fixed The underlying upstream issue has been fixed upstream-issue-linked This is an upstream issue that has been reported upstream verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants