mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 04:28:41 -09:00
Add support for cursor styles 5 and 6 to hterm (#1286)
This fixes #270, cursor shape changing in Neovim.
This commit is contained in:
parent
f2ffafbd10
commit
ccf818de5a
1 changed files with 26 additions and 0 deletions
26
lib/hterm.js
26
lib/hterm.js
|
|
@ -427,5 +427,31 @@ lib.colors.hexToRGB = function (arg) {
|
|||
return arg;
|
||||
};
|
||||
|
||||
// add support for cursor styles 5 and 6, fixes #270
|
||||
hterm.VT.CSI[' q'] = function (parseState) {
|
||||
const arg = parseState.args[0];
|
||||
if (arg === '0' || arg === '1') {
|
||||
this.terminal.setCursorShape(hterm.Terminal.cursorShape.BLOCK);
|
||||
this.terminal.setCursorBlink(true);
|
||||
} else if (arg === '2') {
|
||||
this.terminal.setCursorShape(hterm.Terminal.cursorShape.BLOCK);
|
||||
this.terminal.setCursorBlink(false);
|
||||
} else if (arg === '3') {
|
||||
this.terminal.setCursorShape(hterm.Terminal.cursorShape.UNDERLINE);
|
||||
this.terminal.setCursorBlink(true);
|
||||
} else if (arg === '4') {
|
||||
this.terminal.setCursorShape(hterm.Terminal.cursorShape.UNDERLINE);
|
||||
this.terminal.setCursorBlink(false);
|
||||
} else if (arg === '5') {
|
||||
this.terminal.setCursorShape(hterm.Terminal.cursorShape.BEAM);
|
||||
this.terminal.setCursorBlink(true);
|
||||
} else if (arg === '6') {
|
||||
this.terminal.setCursorShape(hterm.Terminal.cursorShape.BEAM);
|
||||
this.terminal.setCursorBlink(false);
|
||||
} else {
|
||||
console.warn('Unknown cursor style: ' + arg);
|
||||
}
|
||||
};
|
||||
|
||||
export default hterm;
|
||||
export {lib};
|
||||
|
|
|
|||
Loading…
Reference in a new issue