julia, termcap, ANSI control sequences

Skip to first unread message

Tamas Papp

Oct 26, 2016, 4:46:40 AM10/26/16
to julia-dev
I am working on an Emacs extension for using the Julia REPL inside
Emacs. Since debugging with Gallium needs more terminal capabilities
than ESS allows, I am basing it on term.el.

By default, term in Emacs sends cursor keys as \eOA, \eOB, ... for up,
down, ... . I found that I need to change them to \e[A and \e[B to make
the Julia REPL recall history correctly.

I don't know much about terminals, so mostly I found this out by
experiment. I am wondering though if either term.el, Julia's readline,
or something in between is behaving incorrectly. As far as I understand,
term.el advertises keys correctly:

_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.5.0 (2016-09-19 18:14 UTC)
_/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-pc-linux-gnu

julia> ENV["TERMCAP"]

If anyone is interested, preliminary code for the minor mode is here:
Can be used in with julia-emacs.

Any help or advice would be appreciated (again, I know little about how
these things are supposed to work).



Isaiah Norton

Oct 26, 2016, 9:32:31 AM10/26/16
to juli...@googlegroups.com
If you want to see the default keymap definitions, look in `base/LineEdit.jl`. As far as I can tell, Julia's REPL is using the correct raw key codes, so I'm not really sure what Emacs is doing.

Tamas Papp

Oct 26, 2016, 9:41:34 AM10/26/16
to juli...@googlegroups.com
Please forgive my ignorance about this, but I was under the impression
that there is no single set of codes, instead, they are described by the
TERMCAP. It appears that some terminals use \eOA etc, some \e[A. See
Reply all
Reply to author
0 new messages