@@ -14,7 +14,7 @@ export const enum TokenType {
14
14
export const shellTypeResetChars = new Map < TerminalShellType , string [ ] > ( [
15
15
[ TerminalShellType . Bash , [ '>' , '>>' , '<' , '2>' , '2>>' , '&>' , '&>>' , '|' , '|&' , '&&' , '||' , '&' , ';' , '(' , '{' , '<<' ] ] ,
16
16
[ TerminalShellType . Zsh , [ '>' , '>>' , '<' , '2>' , '2>>' , '&>' , '&>>' , '<>' , '|' , '|&' , '&&' , '||' , '&' , ';' , '(' , '{' , '<<' , '<<<' , '<(' ] ] ,
17
- [ TerminalShellType . PowerShell , [ '>' , '>>' , '<' , '2>' , '2>>' , '*>' , '*>>' , '|' , ';' , '-and' , '-or' , '-not' , '!' , '&' , '-eq' , '-ne' , '-gt' , '-lt' , '-ge' , '-le' , '-like' , '-notlike' , '-match' , '-notmatch' , '-contains' , '-notcontains' , '-in' , '-notin' ] ]
17
+ [ TerminalShellType . PowerShell , [ '>' , '>>' , '<' , '2>' , '2>>' , '*>' , '*>>' , '|' , ';' , ' -and ' , ' -or ' , ' -not ' , '!' , '&' , ' -eq ' , ' -ne ' , ' -gt ' , ' -lt ' , ' -ge ' , ' -le ' , ' -like ' , ' -notlike ' , ' -match ' , ' -notmatch ' , ' -contains ' , ' -notcontains ' , ' -in ' , ' -notin ' ] ]
18
18
] ) ;
19
19
20
20
export const defaultShellTypeResetChars = shellTypeResetChars . get ( TerminalShellType . Bash ) ! ;
@@ -31,7 +31,7 @@ export function getTokenType(ctx: { commandLine: string; cursorPosition: number
31
31
32
32
// Look for " <reset char> " before the word
33
33
for ( const resetChar of commandResetChars ) {
34
- const pattern = ` ${ resetChar } ` ;
34
+ const pattern = shellType === TerminalShellType . PowerShell ? ` ${ resetChar } ` : ` ${ resetChar } ` ;
35
35
if ( beforeWord . endsWith ( pattern ) ) {
36
36
return TokenType . Command ;
37
37
}
0 commit comments