You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Being experimenting with running bubbletea programs inside vim/neovim using :!app, here's what I've found:
Problem 1: stdin and opening a tty
If you don't pass a WithInput option, bubbletea will fallback to /dev/stdin, which is OK, but then it'll try to open a new tty, which fails inside vim.
Passing WithInput(nil) fixes the issue.
Problem 1.2: WithInput(os.Stdin)
If instead of a nil input, you pass os.Stdin directly, you get a even weirder error:
:!go run .
^[[?25lcould not run program: error creating cancelreader: add reader to epoll interest list
exit status 1
shell returned 1
Problem 2: ansi escape codes in output
Ok, let's keep the WithInput(nil), if you then run the program from within vim, you'll get ansi escape code sequences all over the place:
Being experimenting with running bubbletea programs inside vim/neovim using
:!app
, here's what I've found:Problem 1: stdin and opening a tty
If you don't pass a
WithInput
option, bubbletea will fallback to/dev/stdin
, which is OK, but then it'll try to open a new tty, which fails inside vim.Passing
WithInput(nil)
fixes the issue.Problem 1.2:
WithInput(os.Stdin)
If instead of a
nil
input, you passos.Stdin
directly, you get a even weirder error:Problem 2: ansi escape codes in output
Ok, let's keep the
WithInput(nil)
, if you then run the program from within vim, you'll get ansi escape code sequences all over the place:To be honest, that seems to happen with other things too, e.g., fish shell:
Footnotes
The text was updated successfully, but these errors were encountered: