jbang icon indicating copy to clipboard operation
jbang copied to clipboard

`jbang edit --open=vi ...` doesn't work

Open quintesse opened this issue 3 years ago • 2 comments

Running jbang init suggested that I could run jbang edit --open=vi ... but when I do that Jbang prints out a command with sh -c vi ..... but nothing happens. If I try another editor like code it does work.

quintesse avatar Jan 24 '22 16:01 quintesse

Not sure exactly what the reason is, it seems to have something to do with the way Java's ProcessBuilder does things. A sort of workaround would be to treat console editors, like vi and emacs, differently and run them like we run Jbang scripts. But that would prevent the --live option from working (because Jbang would no longer be running). Another option, the easiest, would be to simply remove vi and emacs from the list of suggested editors...

quintesse avatar Jan 24 '22 17:01 quintesse

@quintesse Considering that jbang targets scripting ecosystems and shells, it will be useful to retain support for emacs and vim, I think. It may probably be fine not to have --live. I just ran into this when trying to edit with emacs. Thanks

benignbala avatar Mar 07 '22 16:03 benignbala