Skip to content

Commit 9637c47

Browse files
committed
check if mac
1 parent a5fabc6 commit 9637c47

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/vs/workbench/contrib/terminalContrib/accessibility/browser/textAreaSyncAddon.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { ITerminalLogService } from 'vs/platform/terminal/common/terminal';
1010
import type { Terminal, ITerminalAddon } from 'xterm';
1111
import { debounce } from 'vs/base/common/decorators';
1212
import { addDisposableListener } from 'vs/base/browser/dom';
13+
import { isMacintosh } from 'vs/base/common/platform';
1314

1415
export interface ITextAreaData {
1516
content: string;
@@ -100,9 +101,10 @@ export class TextAreaSyncAddon extends Disposable implements ITerminalAddon {
100101
this._logService.debug(`TextAreaSyncAddon#updateCommandAndCursor: no line`);
101102
return;
102103
}
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;
106108
} else {
107109
this._currentCommand = undefined;
108110
this._cursorX = undefined;

0 commit comments

Comments
 (0)