vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Terminal Ignoring First Character Of Input Via `Terminal.sendText`

Open revrenlove opened this issue 1 year ago • 17 comments

Type: Bug

So, I've been noticing this for a while now, but a lot of times (not every time) when I am using the terminal in VSCode and start typing, the initial first key press doesn't get recognized. I just thought it was a quirk and is easy enough to ignore...

BUT...

I have an extension I have authored that utilizes the terminal to execute commands. I have just noticed that (intermittently) when I call the sendText method, the first character of the string passed into that method also gets ignored.

Given the following code:

const terminal = vscode.window.createTerminal("MyTerminal");

terminal.sendText("cd ..");

I would expect the command being sent to the terminal to be cd .., but in the terminal (and only sometimes) it attempts to execute d .. - which is obviously not what is expected.

Is there any way to mitigate this? Is this just a bug in the actual terminal?

VS Code version: Code 1.90.0 (89de5a8d4d6205e5b11647eb6a74844ca23d2573, 2024-06-04T19:33:54.889Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i7-13620H (16 x 2918)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 15.71GB (6.22GB free)
Process Argv --crash-reporter-id 34d3cda8-5b84-4fa8-8387-6931ddf6106c
Screen Reader no
VM 0%
Extensions: none
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
vscaat:30438848
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
jchc7451:31067544
showvideot:31016892
chatpanelc:31048052
dsvsc021:30996838
jg8ic977:31013176
pythoncenvpt:31062603
a69g1124:31058053
dvdeprecation:31068756
pythonprt:31056678
dwnewjupyter:31046869
newcmakeconfigv2:31071590
26j00206:31048877

revrenlove avatar Jun 13 '24 03:06 revrenlove