File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/vs/workbench/contrib/terminalContrib/accessibility/browser Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { ITerminalLogService } from 'vs/platform/terminal/common/terminal';
10
10
import type { Terminal , ITerminalAddon } from 'xterm' ;
11
11
import { debounce } from 'vs/base/common/decorators' ;
12
12
import { addDisposableListener } from 'vs/base/browser/dom' ;
13
+ import { isMacintosh } from 'vs/base/common/platform' ;
13
14
14
15
export interface ITextAreaData {
15
16
content : string ;
@@ -100,9 +101,10 @@ export class TextAreaSyncAddon extends Disposable implements ITerminalAddon {
100
101
this . _logService . debug ( `TextAreaSyncAddon#updateCommandAndCursor: no line` ) ;
101
102
return ;
102
103
}
103
- if ( ! ! currentCommand ) {
104
- this . _currentCommand = commandLine . substring ( currentCommand . commandStartX ?? 0 ) ;
105
- this . _cursorX = buffer . cursorX - ( currentCommand . commandStartX ?? 0 ) ;
104
+ const startX = isMacintosh ? currentCommand . commandStartX : 0 ;
105
+ if ( ! ! currentCommand && ! ! startX ) {
106
+ this . _currentCommand = commandLine . substring ( startX ) ;
107
+ this . _cursorX = buffer . cursorX - startX ;
106
108
} else {
107
109
this . _currentCommand = undefined ;
108
110
this . _cursorX = undefined ;
You can’t perform that action at this time.
0 commit comments