crlf mode, cursor style config; changed Attrs Word to 3B
This commit is contained in:
+5
-3
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -51,6 +51,7 @@ return [
|
||||
'term.default_fg_bg' => 'Text / background',
|
||||
'term.buttons' => 'Button labels',
|
||||
'term.theme' => 'Color scheme',
|
||||
'term.cursor_shape' => 'Cursor style',
|
||||
'term.parser_tout_ms' => 'Parser timeout',
|
||||
'term.display_tout_ms' => 'Redraw delay',
|
||||
'term.display_cooldown_ms' => 'Redraw cooldown',
|
||||
@@ -58,8 +59,16 @@ return [
|
||||
'term.show_config_links' => 'Show nav links',
|
||||
'term.show_buttons' => 'Show buttons',
|
||||
'term.loopback' => 'Local Echo',
|
||||
'term.crlf_mode' => 'Enter sends CR+LF',
|
||||
'term.button_msgs' => 'Button codes<br>(ASCII, dec, CSV)',
|
||||
|
||||
'cursor.block_blink' => 'Block, blinking',
|
||||
'cursor.block_steady' => 'Block, steady',
|
||||
'cursor.underline_blink' => 'Underline, blinking',
|
||||
'cursor.underline_steady' => 'Underline, steady',
|
||||
'cursor.bar_blink' => 'I-bar, blinking',
|
||||
'cursor.bar_steady' => 'I-bar, steady',
|
||||
|
||||
// terminal color labels
|
||||
'color.0' => 'Black',
|
||||
'color.1' => 'Red',
|
||||
|
||||
@@ -108,6 +108,18 @@
|
||||
<input class="short" type="text" name="btn5" id="btn5" value="%h:btn5%">
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
<label><?= tr("term.cursor_shape") ?></label>
|
||||
<select name="cursor_shape" id="cursor_shape">
|
||||
<option value="0"><?= tr("cursor.block_blink") ?></option>
|
||||
<option value="2"><?= tr("cursor.block_steady") ?></option>
|
||||
<option value="3"><?= tr("cursor.underline_blink") ?></option>
|
||||
<option value="4"><?= tr("cursor.underline_steady") ?></option>
|
||||
<option value="5"><?= tr("cursor.bar_blink") ?></option>
|
||||
<option value="6"><?= tr("cursor.bar_steady") ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="Row buttons">
|
||||
<a class="button icn-ok" href="#" onclick="qs('#form-1').submit()"><?= tr('apply') ?></a>
|
||||
</div>
|
||||
@@ -153,6 +165,12 @@
|
||||
<input type="hidden" id="fn_alt_mode" name="fn_alt_mode" value="%fn_alt_mode%">
|
||||
</div>
|
||||
|
||||
<div class="Row checkbox" >
|
||||
<label><?= tr('term.crlf_mode') ?></label><!--
|
||||
--><span class="box" tabindex=0 role=checkbox></span>
|
||||
<input type="hidden" id="crlf_mode" name="crlf_mode" value="%crlf_mode%">
|
||||
</div>
|
||||
|
||||
<div class="Row checkbox" >
|
||||
<label><?= tr('term.show_buttons') ?></label><!--
|
||||
--><span class="box" tabindex=0 role=checkbox></span>
|
||||
@@ -179,6 +197,7 @@
|
||||
<script>
|
||||
$('#default_fg').val(%default_fg%);
|
||||
$('#default_bg').val(%default_bg%);
|
||||
$('#cursor_shape').val(%cursor_shape%);
|
||||
$('#theme').val(%theme%);
|
||||
|
||||
function showColor() {
|
||||
|
||||
Reference in New Issue
Block a user