1

I use TMUX and vim for everything, and recently started working with Elixir. Whenever I run an elixir process, including iex -S mix, I cannot use the error keys as it instead prints out ^[[A for the up arrow, ^[[B for the down arrow, etc.

How can I fix TMUX or iex so they can properly communicate the arrow keys?

EDIT 1:

Output of echo $TERM is tmux-256color. My terminals are set up following this tutorial: https://medium.com/@dubistkomisch/how-to-actually-get-italics-and-true-colour-to-work-in-iterm-tmux-vim-9ebe55ebc2be

I have three machines set up with the same terminals and same config files (shared by a GitHub repo). On two machines (one iMac, one MacBook Prop) the up arrow works and on one machine (MacBook Air) the up arrows don't. How can I go about finding what is not working on the one machine?

EDIT 2:

Elixir and erlang versions are the same:

Erlang/OTP 22 [erts-10.5.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace]

Elixir 1.9.1 (compiled with Erlang/OTP 22)
Jon
  • 3,573
  • 2
  • 17
  • 24
cadlac
  • 2,802
  • 3
  • 18
  • 34

1 Answers1

0

Elixir's interactive shell iex does not know about arrow-keys (for command-history) by default. According to its documentation, you can enable that when starting it:

  • start with a parameter:

    iex --erl "-kernel shell_history enabled"

  • start with an environment variable:

    export ERL_AFLAGS="-kernel shell_history enabled"

As an alternative, rlwrap can be used for this (and other programs).

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105