Changeset View
Changeset View
Standalone View
Standalone View
bin/sh/histedit.c
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | if (editing && !el && isatty(0)) { /* && isatty(2) ??? */ | ||||
unsetenv("TERM"); | unsetenv("TERM"); | ||||
el = el_init(arg0, el_in, el_out, el_out); | el = el_init(arg0, el_in, el_out, el_out); | ||||
if (el != NULL) { | if (el != NULL) { | ||||
if (hist) | if (hist) | ||||
el_set(el, EL_HIST, history, hist); | el_set(el, EL_HIST, history, hist); | ||||
el_set(el, EL_PROMPT, getprompt); | el_set(el, EL_PROMPT, getprompt); | ||||
el_set(el, EL_ADDFN, "sh-complete", | el_set(el, EL_ADDFN, "sh-complete", | ||||
"Filename completion", | "Filename completion", | ||||
_el_fn_sh_complete); | _el_fn_complete); | ||||
} else { | } else { | ||||
bad: | bad: | ||||
out2fmt_flush("sh: can't initialize editing\n"); | out2fmt_flush("sh: can't initialize editing\n"); | ||||
} | } | ||||
INTON; | INTON; | ||||
} else if (!editing && el) { | } else if (!editing && el) { | ||||
INTOFF; | INTOFF; | ||||
el_end(el); | el_end(el); | ||||
▲ Show 20 Lines • Show All 388 Lines • Show Last 20 Lines |