tpapp / julia-repl

Run an inferior Julia REPL in a terminal inside Emacs
Other
170 stars 35 forks source link

*julia* buffer breaks key bindings in *terminal* buffer #72

Closed xor-xor closed 3 years ago

xor-xor commented 4 years ago
  1. Emacs version: GNU Emacs 26.3 (build 1, x86_64-apple-darwin16.7.0, Carbon Version 157 AppKit 1504.83) of 2019-09-07
  2. Julia version: 1.2.0 (2019-08-20)
  3. julia-repl version: 20190908.1717

Steps to reproduce:

  1. Fire up Emacs.
  2. Run M-x term with e.g. /bin/bash in it.
  3. Produce some output with e.g. ls -al ~.
  4. Switch to line mode with C-c C-j.
  5. Observe that moving up/down through the output produced in (3) works as expected (with up/down arrows or C-p/C-n).
  6. Go back to char mode with C-c C-k.
  7. Run julia-repl with C-c M-x julia-repl.
  8. Switch back to *terminal* buffer created in (2).
  9. Observe that switching to line mode with C-c C-j doesn't work anymore (C-c C-j is undefined).

The above also happens when *terminal* buffer is created after *julia* buffer.

recri commented 4 years ago

Okay, I see what happened.

The startup for julia-repl contains (term-set-escape-char ?\C-x) ; useful for switching windows That globally changes the term mode escape character from C-c to C-x, ie for all term based buffers in emacs that are already running or are started after julia-repl starts.

Globally remapping the escape character is something that a user should decide to do and run in their .emacs, not something that julia-repl should do for the user.

tpapp commented 4 years ago

Good point. I will look into making a derived mode from term, or failing that will make this customization optional.

tpapp commented 4 years ago

I introduced an option in #84 for this, but generally using vterm should be the right approach (as introduced in that PR).