Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bad interactions between sbt and jline2 on Mac OSx #296

Open
weallcock opened this issue Dec 20, 2018 · 0 comments
Open

bad interactions between sbt and jline2 on Mac OSx #296

weallcock opened this issue Dec 20, 2018 · 0 comments

Comments

@weallcock
Copy link

weallcock commented Dec 20, 2018

I have never worked with Java before, and am actually only working with it indirectly as I am using the scala sbt, so apologies if I am missing something obvious. I am trying to take the Coursera "Functional Programming Principles in Scala" class which requires the use of sbt and this bug makes that nearly impossible, since I cant recall or edit command lines, so I would really appreciate some guidance on how to resolve this.

My config:

  • iterm2, build 3.2.6
  • Mac Sierra 10.12.6
  • TERM = xterm-256-color.
  • java version "1.8.0_192"

I put an issue in with sbt: sbt/sbt#4493 which has some additional detail, but the gist was that they indicated it was a bad interaction with jline2. Here is what I see

> ^[[A^[[B^[[C^[[D

I thought it was resolved in that the backspace key began to work as expected, when I set terminal=false, but I failed to check the arrow keys and they do not work as expected. I have tried every documented value of jline.terminal that I could find (unix, false, auto, none, off, even win). Some of those fix the backspace problem, but none of them fix the arrow problem. I have a .inputrc. It defines option/alt-"arrow key" and shift-option/alt-"arrow key", but not just the arrow keys. It is picking those key definitions up from the .inputrc, but it is just putting the escape sequence up, not actually implementing the command (forward-word, back-word, beginning-of-line, end-of-line) I created a .jline.rc file, but that did not work. Here are the contents:

"\e[A": previous-history
"\e[B": next-history

Those are the correct escape sequences to the best of my knowledge (I hit up, down, right, left, the second line used ctrl-v):

narya:example allcock$ sed -n l
^[[A^[[B^[[C^[[D
\033[A\033[B\033[C\033[D$
^C
narya:example allcock$ ^[[A^[[B^[[C^[[D

I saw some different names for the config file, so I tried:

sbt -Djline.configuration=/Users/allcock/.jline.rc

but that didn't work either. It wasn't clear if that was going to be a pass-through to the JVM, but I assumed so.

I would really appreciate any help you could provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant