Skip to content

Commit

Permalink
fix: don't predict git log/less
Browse files Browse the repository at this point in the history
Fixes #109541
  • Loading branch information
connor4312 committed Oct 28, 2020
1 parent ced7404 commit ee0aff2
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,14 @@ export class TypeAheadAddon extends Disposable implements ITerminalAddon {
const terminal = this.timeline.terminal;
const buffer = terminal.buffer.active;

// Detect programs like git log/less that use the normal buffer but don't
// take input by deafult (fixes #109541)
if (buffer.cursorX === 1 && buffer.cursorY === terminal.rows - 1) {
if (buffer.getLine(buffer.cursorY + buffer.baseY)?.getCell(0)?.getChars() === ':') {
return;
}
}

// the following code guards the terminal prompt to avoid being able to
// arrow or backspace-into the prompt. Record the lowest X value at which
// the user gave input, and mark all additions before that as tentative.
Expand Down

0 comments on commit ee0aff2

Please sign in to comment.