Skip to content

JLine 3: handle .inputrc? #12269

Closed
scala/scala
#9518
@SethTisue

Description

@SethTisue

at scala/scala#8036 (comment) , @retronym wrote:

In our usage of JLine2, we picked up configuration from ~/.inputrc etc.

JLine3 does have support for parsing this file since jline/jline3@9ccfe0b, but it looks like we need to call InputRC.configure after determining which config file to use ourselves.

Furthermore, in the current configuration file, sections guarded with $if JLine .... $endif are interpreted by the Scala REPL. Under this change, config would need to be moved to $if scala (the appname used here. That's probably fine if release noted.

Here's my .inputrc for reference.

$if Bash
	"\e[A": history-search-backward
	"\e[B": history-search-forward
    Space: magic-space
$endif

#set blink-matching-paren on
"\C-xq": "\eb\"\ef\""

"\C-x)": "\ea\(\ee\)"

$if JLine
	"\C-xu": "import scala.tools.reflect.ToolBox; val m = scala.reflect.runtime.currentMirror; val u = m.universe; import u._; val tb = m.mkToolBox()"
	"\C-x)": "\C-a(\C-e)"
	"\C-x}": "\C-a{\C-e}"
	"\C-x{": "{}\C-b"
	"\C-x(": "()\C-b"

$endif

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions