@@ -46,14 +46,14 @@ suite('PromptInputModel', () => {
46
46
47
47
promptInputModel . forceSync ( ) ;
48
48
49
- const actualValueWithCursor = promptInputModel . value . substring ( 0 , promptInputModel . cursorIndex ) + '|' + promptInputModel . value . substring ( promptInputModel . cursorIndex ) ;
49
+ const actualValueWithCursor = promptInputModel . getCombinedString ( ) ;
50
50
strictEqual (
51
51
actualValueWithCursor . replaceAll ( '\n' , '\u23CE' ) ,
52
52
valueWithCursor . replaceAll ( '\n' , '\u23CE' )
53
53
) ;
54
54
55
55
// This is required to ensure the cursor index is correctly resolved for non-ascii characters
56
- const value = valueWithCursor . replace ( '|' , '' ) ;
56
+ const value = valueWithCursor . replace ( / [ \| \[ \] ] / g , '' ) ;
57
57
const cursorIndex = valueWithCursor . indexOf ( '|' ) ;
58
58
strictEqual ( promptInputModel . value , value ) ;
59
59
strictEqual ( promptInputModel . cursorIndex , cursorIndex , `value=${ promptInputModel . value } ` ) ;
@@ -222,31 +222,31 @@ suite('PromptInputModel', () => {
222
222
'[?25l[93me[97m[2m[3mcho "hello world"[3;4H[?25h' ,
223
223
'[m' ,
224
224
] ) ;
225
- assertPromptInput ( 'e|cho "hello world"' ) ;
225
+ assertPromptInput ( 'e|[ cho "hello world"] ' ) ;
226
226
227
227
await replayEvents ( [
228
228
'[?25l[93mec[97m[2m[3mho "hello world"[3;5H[?25h' ,
229
229
'[m' ,
230
230
] ) ;
231
- assertPromptInput ( 'ec|ho "hello world"' ) ;
231
+ assertPromptInput ( 'ec|[ ho "hello world"] ' ) ;
232
232
233
233
await replayEvents ( [
234
234
'[?25l[93m[3;3Hech[97m[2m[3mo "hello world"[3;6H[?25h' ,
235
235
'[m' ,
236
236
] ) ;
237
- assertPromptInput ( 'ech|o "hello world"' ) ;
237
+ assertPromptInput ( 'ech|[ o "hello world"] ' ) ;
238
238
239
239
await replayEvents ( [
240
240
'[?25l[93m[3;3Hecho[97m[2m[3m "hello world"[3;7H[?25h' ,
241
241
'[m' ,
242
242
] ) ;
243
- assertPromptInput ( 'echo| "hello world"' ) ;
243
+ assertPromptInput ( 'echo|[ "hello world"] ' ) ;
244
244
245
245
await replayEvents ( [
246
246
'[?25l[93m[3;3Hecho [97m[2m[3m"hello world"[3;8H[?25h' ,
247
247
'[m' ,
248
248
] ) ;
249
- assertPromptInput ( 'echo |"hello world"' ) ;
249
+ assertPromptInput ( 'echo |[ "hello world"] ' ) ;
250
250
251
251
await replayEvents ( [
252
252
'[?25l[93m[3;3Hecho [36m"hello world"[?25h' ,
0 commit comments