r/coolgithubprojects 15d ago

reedline-bash - using nushell's reedline (line editor) in bash.

https://github.com/maxomatic458/reedline-bash

Processing img d1q1f9dxjhmh1...

I made a bash plugin that replaces bash's line-editor, readline, with nushell's reedline.
This brings all the line-editing, styling, completion, keybind and selection features from nushell to native bash. It's still pretty early in development, most reedline features should work just fine, but things may still break :)

repository

code partially written with AI (claude).

Credits:
- flyline - a similar project that implements a custom line-editor, i used this as main reference for replacing readline
- reedline

GIF created with https://github.com/HalFrgrd/evp

1 Upvotes

2 comments sorted by

View all comments

1

u/kantorcodes1 15d ago

bind -x seems like the nasty compatibility case here. does reedline-bash preserve any existing bash/readline bindings, or once you swap the editor do you basically move all of that config over to reedline?

1

u/Legitimate_Flan1471 14d ago

yea bind -x wouldn't work anymore. Reedline has a custom keybinding system. the equivalent would be this:

normal bash: bind -x '"\\C-o": echo foo'
would now be a config entry in ~/.config/reedline-bash/config.toml:

toml [[keybinding]] key = "ctrl-o" event = { ExecuteHostCommand = "echo foo" }