let tui = {
mode: mode_chat,
log: [],
+ input_prompt: '> ',
input: '',
input_lines: [],
window_width: terminal.cols / 2,
}
},
add_to_input: function(str) {
- if (this.input.length + str.length > this.window_width * terminal.rows) {
+ if (this.input_prompt.length + this.input.length + str.length > this.window_width * terminal.rows) {
return;
}
this.input += str;
this.recalc_input_lines();
},
recalc_input_lines: function() {
- this.input_lines = this.msg_into_lines_of_width("> " + this.input, this.window_width);
+ this.input_lines = this.msg_into_lines_of_width(this.input_prompt + this.input, this.window_width);
this.height_input = this.input_lines.length;
},
shorten_input: function() {