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

workbench.action.terminal.deleteWordRight not found #95802

Closed
amelio-vazquez-reina opened this issue Apr 21, 2020 · 5 comments
Closed

workbench.action.terminal.deleteWordRight not found #95802

amelio-vazquez-reina opened this issue Apr 21, 2020 · 5 comments
Assignees
Labels
*as-designed Described behavior is as designed

Comments

@amelio-vazquez-reina
Copy link

Issue Type: Bug

Just run into this problem today after upgrading to the latest insiders version. See the screenshot below.

image

VS Code version: Code - Insiders 1.45.0-insider (b83339a, 2020-04-21T05:38:43.781Z)
OS version: Darwin x64 19.4.0

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2300)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 64.00GB (1.83GB free)
Process Argv -psn_0_14470604
Screen Reader no
VM 0%
Extensions (33)
Extension Author (truncated) Version
atlascode atl 2.5.1
vscode-database baj 2.2.0
path-intellisense chr 1.4.2
bracket-pair-colorizer Coe 1.0.61
vscode-markdownlint Dav 0.34.0
gitlens eam 10.2.1
LogFileHighlighter emi 2.8.0
shell-format fox 7.0.1
seito-openfile Fr4 1.8.5
mdmath goe 2.4.0
gc-excelviewer Gra 2.1.34
open-file-from-path jac 1.3.3
latex-workshop Jam 8.8.0
vsc-space-block-jumper jmf 1.2.2
center-editor-window kai 2.3.0
vscode-docker ms- 1.1.0
python ms- 2020.3.71659
sqltools mtx 0.21.7
highlight-dodgy-characters nac 1.0.0
neuron-IPE neu 1.0.4
vscode-ipython pan 0.5.0
advanced-new-file pat 1.2.0
vscode-versionlens pfl 0.25.0
vscode-yaml red 0.7.2
vscode-dired rru 0.0.5
code-settings-sync Sha 3.4.3
trailing-spaces sha 0.3.1
vscode-fileutils sle 3.0.1
emacs-mcx tut 0.18.0
vscodeintellicode Vis 1.2.6
vscode-icons vsc 10.1.1
org-mode vsc 1.0.0
markdown-all-in-one yzh 2.8.0
@Tyriar
Copy link
Member

Tyriar commented Apr 22, 2020

This command was removed intentionally as all it did was send something to the terminal which can be done generically with the sendSequence command. If you want to run this command now you need to call this command:

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

This does the same thing as pressing alt+d in the terminal.

While the old very specific commands were nice because they were named, they were also a black box and it wasn't clear how it worked. I'm hoping #94556 gets fixed and that way you can open the default keybindings file and be able to see exactly how they work:

image

@Tyriar Tyriar closed this as completed Apr 22, 2020
@Tyriar Tyriar added the *as-designed Described behavior is as designed label Apr 22, 2020
@Tyriar
Copy link
Member

Tyriar commented Apr 22, 2020

It's possible an extension is calling this command, in which case I'd be interested to hear which one

@Tyriar
Copy link
Member

Tyriar commented Apr 22, 2020

Ok I just fixed it, this is what you should see soon which helps users understand what is happening:

image

@amelio-vazquez-reina
Copy link
Author

amelio-vazquez-reina commented Apr 22, 2020

Thanks @Tyriar 👍 I actually tried to use sendSequence originally (see this Q of mine in SO for context), but I couldn't find the control sequence for forward/backward deletion. E.g. see this follow-up question of mine in Unix.SE where I ask for the XTerm control sequence for forward/backward deletion, and I am told that none exist (by Stéphane Chazelas, a well-known top user on the site). Hmm, what am I missing here? e.g how did you know that was the right sequence of characters to send?

@Tyriar
Copy link
Member

Tyriar commented Apr 23, 2020

@amelio-vazquez-reina those are based on common keystrokes and aren't guaranteed to work. I see backward-kill-word is mentioned, I think that's one of them. You can see the comments where these keybindings are added for what they are:

// Delete word left: ctrl+w
registerSendSequenceKeybinding(String.fromCharCode('W'.charCodeAt(0) - 64), {
primary: KeyMod.CtrlCmd | KeyCode.Backspace,
mac: { primary: KeyMod.Alt | KeyCode.Backspace }
});
// Delete word right: alt+d
registerSendSequenceKeybinding('\x1bd', {
primary: KeyMod.CtrlCmd | KeyCode.Delete,
mac: { primary: KeyMod.Alt | KeyCode.Delete }
});
// Delete to line start: ctrl+u
registerSendSequenceKeybinding('\u0015', {
mac: { primary: KeyMod.CtrlCmd | KeyCode.Backspace }
});
// Move to line start: ctrl+A
registerSendSequenceKeybinding(String.fromCharCode('A'.charCodeAt(0) - 64), {
mac: { primary: KeyMod.CtrlCmd | KeyCode.LeftArrow }
});
// Move to line end: ctrl+E
registerSendSequenceKeybinding(String.fromCharCode('E'.charCodeAt(0) - 64), {
mac: { primary: KeyMod.CtrlCmd | KeyCode.RightArrow }
});

Also the way I typically get these sequences is by enabling escape sequence logging in VS Code which will print out the character codes that get sent to and from the terminal:

image

But yeah, all this is best effort and may not actually work. Since the sendSequence command and out keybindings system is so flexible though you can get whatever behavior you're after if your shell lets you do it.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed
Projects
None yet
Development

No branches or pull requests

2 participants