hanslub42 / rlwrap

A readline wrapper
GNU General Public License v2.0
2.59k stars 151 forks source link

Rlwrap doesn't work from inside Emacs' vterm or term #184

Closed papadakis-k closed 8 months ago

papadakis-k commented 11 months ago

Hello. I had done some investigation already, after having trouble using rlwrap from within Emacs' vterm mode. Copying from here the relevant parts.

Minimum steps to reproduce

  1. Install/compile rlwrap 0.45 or later.
  2. Install ed editor
  3. Launch vterm in emacs
  4. Type rlwrap ed
  5. Type Ctrl-e

Expected: move cursor to the end of the line Actual: character '^E' appears

Explanation

The check added in this commit is good for shell and eshell mode, where the TERM is "dumb" and line editing is already handled by Emacs, but for the terminal modes, vterm and term, where there is no interference of Emacs with the line input, rlwrap just doesn't work. I believe we should differentiate between the two cases, "dumb" TERM or not, in order to make rlwrap work inside vterm and term.