Skip to content

Commit

Permalink
Merge pull request #1850 from Tyriar/vscode65485
Browse files Browse the repository at this point in the history
Fix winptyCompat wrapped line heuristic
  • Loading branch information
Tyriar committed Dec 20, 2018
2 parents 90ec907 + 71d8a4d commit 61d0e99
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/addons/winptyCompat/winptyCompat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { Terminal } from 'xterm';
import { IWinptyCompatAddonTerminal } from './Interfaces';

const CHAR_DATA_CODE_INDEX = 3;
const NULL_CELL_CODE = 32;
const NULL_CELL_CODE = 0;
const WHITESPACE_CELL_CODE = 32;

export function winptyCompatInit(terminal: Terminal): void {
const addonTerminal = <IWinptyCompatAddonTerminal>terminal;
Expand All @@ -32,7 +33,7 @@ export function winptyCompatInit(terminal: Terminal): void {
const line = addonTerminal._core.buffer.lines.get(addonTerminal._core.buffer.ybase + addonTerminal._core.buffer.y - 1);
const lastChar = line.get(addonTerminal.cols - 1);

if (lastChar[CHAR_DATA_CODE_INDEX] !== NULL_CELL_CODE) {
if (lastChar[CHAR_DATA_CODE_INDEX] !== NULL_CELL_CODE && lastChar[CHAR_DATA_CODE_INDEX] !== WHITESPACE_CELL_CODE) {
const nextLine = addonTerminal._core.buffer.lines.get(addonTerminal._core.buffer.ybase + addonTerminal._core.buffer.y);
nextLine.isWrapped = true;
}
Expand Down

0 comments on commit 61d0e99

Please sign in to comment.