crlf mode, cursor style config; changed Attrs Word to 3B

This commit is contained in:
2017-09-09 23:50:36 +02:00
parent 22101cc000
commit 131389b6a7
4 changed files with 38 additions and 6 deletions
+5 -3
View File
@@ -22,6 +22,7 @@ var Input = (function() {
mt_click: false,
mt_move: false,
no_keys: false,
crlf_mode: false,
};
/** Send a literal message */
@@ -53,7 +54,7 @@ var Input = (function() {
var keymap = {
'tab': '\x09',
'backspace': '\x08',
'enter': '\x0d',
'enter': opts.crlf_mode ? '\x0d\x0a' : '\x0d',
'ctrl+enter': '\x0a',
'esc': '\x1b',
'up': ca('\x1bOA', '\x1b[A'),
@@ -205,11 +206,12 @@ var Input = (function() {
sendString: sendStrMsg,
/** Enable alternate key modes (cursors, numpad, fn) */
setAlts: function(cu, np, fn) {
if (opts.cu_alt != cu || opts.np_alt != np || opts.fn_alt != fn) {
setAlts: function(cu, np, fn, crlf) {
if (opts.cu_alt != cu || opts.np_alt != np || opts.fn_alt != fn || opts.crlf_mode != crlf) {
opts.cu_alt = cu;
opts.np_alt = np;
opts.fn_alt = fn;
opts.crlf_mode = crlf;
// rebind keys - codes have changed
_bindFnKeys();
+5 -3
View File
@@ -226,15 +226,15 @@ var Screen = (function () {
// console.log("Cursor at ",num, num2);
// Attributes
num = parse2B(str, i); i += 2; // fg bg attribs
num = parse3B(str, i); i += 3;
cursor.hidden = !(num & (1<<0)); // DEC opt "visible"
cursor.hanging = !!(num & (1<<1));
// console.log("Attributes word ",num.toString(16)+'h');
Input.setAlts(
!!(num & (1<<2)), // cursors alt
!!(num & (1<<3)), // numpad alt
!!(num & (1<<4)) // fn keys alt
!!(num & (1<<4)), // fn keys alt
!!(num & (1<<12)) // crlf mode
);
var mt_click = !!(num & (1<<5));
@@ -250,6 +250,8 @@ var Screen = (function () {
$('.x-term-conf-btn').toggleClass('hidden', !show_config_links);
$('#action-buttons').toggleClass('hidden', !show_buttons);
// bits 9-11 are cursor shape (not implemented)
fg = 7;
bg = 0;
attrs = 0;