Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

erts: to_erl screen should not be cleared #8943

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions erts/etc/unix/run_erl.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,8 @@ static void pass_on(pid_t childpid)
#endif
}
}

if (!got_some && wfd && buf[0] == '\014') {
if (!got_some && wfd && buf[0] == '\033' &&
buf[1] == 'l') {
char wbuf[30];
int wlen = sn_printf(wbuf,sizeof(wbuf),"[run_erl v%u-%u]\n",
RUN_ERL_HI_VER, RUN_ERL_LO_VER);
Expand Down
14 changes: 5 additions & 9 deletions erts/etc/unix/to_erl.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,16 +351,12 @@ int main(int argc, char **argv)
show_terminal_settings(&tty_smode);
#endif
/*
* "Write a ^L to the FIFO which causes the other end to redisplay
* the input line."
* This does not seem to work as was intended in old comment above.
* However, this control character is now (R12B-3) used by run_erl
* to trigger the version handshaking between to_erl and run_erl
* at the start of every new to_erl-session.
* Write ^[l to the FIFO. This trigger the version handshaking
* between to_erl and run_erl and a redraw in erl, at the start
* of every new to_erl-session.
*/

if (write(wfd, "\014", 1) < 0) {
fprintf(stderr, "Error in writing ^L to FIFO.\n");
if (write(wfd, "\033l", 2) < 0) {
fprintf(stderr, "Error in writing ^[l to FIFO.\n");
}

/*
Expand Down
3 changes: 3 additions & 0 deletions lib/kernel/src/group.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,9 @@ edit_line_dumb([Erase|Cs],[], Rs) when Erase =:= $\177; Erase =:= $\^H ->
edit_line_dumb(Cs,[], Rs);
edit_line_dumb([Erase|Cs],[_|Chars], Rs) when Erase =:= $\177; Erase =:= $\^H ->
edit_line_dumb(Cs,Chars, [{delete_chars, -1}|Rs]);
edit_line_dumb([$\e, $l |Cs],Chars, Rs) ->
%% this is a key sequence sent by to_erl to refresh the screen
edit_line_dumb(Cs,Chars, Rs);
edit_line_dumb([CtrlChar|Cs],Chars, Rs) when CtrlChar < 32 ->
edit_line_dumb(Cs,Chars,Rs);
edit_line_dumb([Char|Cs],Chars, Rs) ->
Expand Down
Loading