File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,14 @@ const unparameterized = PROMPT_ELEMENT_TYPES.filter((element) => element.paramet
35
35
* @returns The prompt element that was read and the cursor position after that element, or `null` on failure.
36
36
*/
37
37
function readUnparameterized ( ps1 : string , cursor : number ) : { element : PromptElement ; newCursor : number } | null {
38
+ // manual handling of the 'Set Window Title' element if it uses octal or hexadecimal escape syntax instead of '\e'
39
+ if ( ps1 . startsWith ( '\\[\\033]0;' , cursor ) || ps1 . startsWith ( '\\[\\x1b]0;' , cursor ) ) {
40
+ return {
41
+ element : new PromptElement ( getPromptElementTypeByNameUnsafe ( 'Set Window Title' ) ) ,
42
+ newCursor : cursor + 9 ,
43
+ } ;
44
+ }
45
+
38
46
// eslint-disable-next-line no-restricted-syntax
39
47
for ( const elementType of unparameterized ) {
40
48
const char = elementType . char ( { } ) ;
You can’t perform that action at this time.
0 commit comments