soimort / translate-shell

:speech_balloon: Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc.
https://www.soimort.org/translate-shell
The Unlicense
6.83k stars 387 forks source link

Space bar not working on REPL mode #507

Closed Dominiquini closed 7 months ago

Dominiquini commented 7 months ago

If I enable 'Magic Space' on my .inputrc:

Space: magic-space

I can't insert any spaces when I'm typing a phase to translate!

Thanks.

soimort commented 7 months ago

This is likely a readline-related issue. Since trans simply calls rlwrap, there is not much we can do about controlling the behavior of spaces.

I suggest checking out this post: https://unix.stackexchange.com/questions/636139/how-to-have-space-magic-space-in-inputrc-without-breaking-python-3-repl and use conditionals to make the magic-space keybinding only apply to Bash/Zsh.

Or you can use trans with option -no-rlwrap to disable readline (but then you won't be able to have command history, etc.)