@@ -12,6 +12,7 @@ import type { ITerminalCommand } from 'vs/platform/terminal/common/capabilities/
12
12
// eslint-disable-next-line local/code-import-patterns, local/code-amd-node-module
13
13
import { Terminal } from '@xterm/headless' ;
14
14
import { strictEqual } from 'assert' ;
15
+ import { timeout } from 'vs/base/common/async' ;
15
16
16
17
class TestPromptInputModel extends PromptInputModel {
17
18
forceSync ( ) {
@@ -285,6 +286,42 @@ suite('PromptInputModel', () => {
285
286
fireCommandStart ( ) ;
286
287
assertPromptInput ( '|' ) ;
287
288
} ) ;
289
+
290
+ test . only ( 'input, go to start (ctrl+home), delete word in front (ctrl+delete)' , async ( ) => {
291
+ await replayEvents ( [
292
+ '[?25l[2J[m[H]0;C:\Program Files\WindowsApps\Microsoft.PowerShell_7.4.2.0_x64__8wekyb3d8bbwe\pwsh.exe[?25h' ,
293
+ '[?25l[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K\r\n[K[H[?25h' ,
294
+ ']633;P;IsWindows=True' ,
295
+ ']633;P;ContinuationPrompt=\x1b[38\x3b5\x3b8m∙\x1b[0m ' ,
296
+ ']633;A]633;P;Cwd=C:\x5cGithub\x5cmicrosoft\x5cvscode]633;B' ,
297
+ '[34m\r\n[38;2;17;17;17m[44m16:07:06 [34m[41m [38;2;17;17;17mvscode [31m[43m [38;2;17;17;17m tyriar/210662 [33m[46m [38;2;17;17;17m$! [36m[49m [mvia [32m[1m v18.18.2 \r\n❯[m ' ,
298
+ ] ) ;
299
+ fireCommandStart ( ) ;
300
+ assertPromptInput ( '|' ) ;
301
+
302
+ await replayEvents ( [
303
+ '[?25l[93mG[97m[2m[3mit push[3;4H[?25h' ,
304
+ '[m' ,
305
+ '[?25l[93mGe[97m[2m[3mt-ChildItem -Path a[3;5H[?25h' ,
306
+ '[m' ,
307
+ '[?25l[93m[3;3HGet[97m[2m[3m-ChildItem -Path a[3;6H[?25h' ,
308
+ ] ) ;
309
+ assertPromptInput ( 'Get|[-ChildItem -Path a]' ) ;
310
+
311
+ await replayEvents ( [
312
+ '[m' ,
313
+ '[?25l[3;3H[?25h' ,
314
+ '[21X' ,
315
+ ] ) ;
316
+
317
+ // Don't force a sync, the prompt input model should update by itself
318
+ await timeout ( 0 ) ;
319
+ const actualValueWithCursor = promptInputModel . getCombinedString ( ) ;
320
+ strictEqual (
321
+ actualValueWithCursor ,
322
+ '|' . replaceAll ( '\n' , '\u23CE' )
323
+ ) ;
324
+ } ) ;
288
325
} ) ;
289
326
} ) ;
290
327
} ) ;
0 commit comments