forked from blinksh/blink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hterm_all.patches.js
56 lines (43 loc) · 1.55 KB
/
hterm_all.patches.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
'use strict';
hterm.Terminal.prototype.onFocusChange_ = function(focused) {};
hterm.Terminal.prototype.onFocusChange__ = function(focused) {
var currentState = this.cursorNode_.getAttribute('focus');
if (currentState === focused + '') {
return;
}
this.cursorNode_.setAttribute('focus', focused);
this.restyleCursor_();
if (this.reportFocus) {
this.io.sendString(focused === true ? '\x1b[I' : '\x1b[O');
}
if (focused === true) this.closeBellNotifications_();
};
// Do not show resize notifications. We show ours
hterm.Terminal.prototype.overlaySize = function() {};
hterm.Terminal.prototype.onMouse_ = function() {};
// TODO: Remove our patch. htermjs supports cursorBlinkPause_ option now
// see https://github.com/chromium/hterm/commit/f57d62de8f91f1fc8923fb000aeace041d063f9f
hterm.Terminal.prototype.setCursorVisible = function(state) {
this.options_.cursorVisible = state;
if (!state) {
if (this.timeouts_.cursorBlink) {
clearTimeout(this.timeouts_.cursorBlink);
delete this.timeouts_.cursorBlink;
}
this.cursorNode_.style.opacity = '0';
return;
}
this.syncCursorPosition_();
this.cursorNode_.style.opacity = '1';
if (this.options_.cursorBlink) {
if (this.timeouts_.cursorBlink) return;
// Blink: Switch the cursor off, so that the manual (first) blink trigger sets it on again
this.cursorNode_.style.opacity = '0';
this.onCursorBlink_();
} else {
if (this.timeouts_.cursorBlink) {
clearTimeout(this.timeouts_.cursorBlink);
delete this.timeouts_.cursorBlink;
}
}
};