Skip to content

Commit

Permalink
[Breaking] Disable ECHO except for newlines
Browse files Browse the repository at this point in the history
Also explicitely set other flags, like ICANON, ISIG, IEXTEN, and
input NL-CR conversion flags.
  • Loading branch information
mildsunrise committed Feb 23, 2019
1 parent a048590 commit 02ddc53
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ function Command(reply, context, command) {
rows: context.size.rows,
cwd: context.cwd,
env: context.env,
}); //FIXME: disable ISIG, ICANON, IEXTEN
});
this.termios = new termios.Termios(this.pty._fd);
this.termios.c_lflag &= ~(tsyms.ISIG | tsyms.IEXTEN);
this.termios.c_lflag &= ~tsyms.ECHO; // disable ECHO
this.termios.c_lflag |= tsyms.ICANON | tsyms.ECHONL; // we need it for /end, it needs to be active beforehand
this.termios.c_iflag = (this.termios.c_iflag & ~(tsyms.INLCR | tsyms.IGNCR)) | tsyms.ICRNL; // CR to NL
this.termios.writeTo(this.pty._fd);

this.terminal = terminal.createTerminal({
Expand All @@ -49,7 +53,7 @@ function Command(reply, context, command) {
startFill: "· ",
});
this._initKeypad();
//FIXME: take additional steps to reduce messages sent to group
//FIXME: take additional steps to reduce messages sent to group. do typing actions count?

// Post initial message
this.initialMessage = new utils.EditedMessage(reply, this._renderInitial(), "HTML");
Expand Down

0 comments on commit 02ddc53

Please sign in to comment.