Skip to content

bad interactions between sbt and jline2 on Mac OSx #296

@weallcock

Description

@weallcock

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions