martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.2k stars 258 forks source link

vis hangs on redirecting STDERR #985

Closed Docbroke closed 1 year ago

Docbroke commented 2 years ago
vis 2>/dev/null
tosch42 commented 1 year ago

Hi,

vis prints its UI to stderr instead of stdout. By redirecting stderr to a file, you basically redirect vis' UI to the file. This can be reproduced by doing the following:

$ vis 2> log
$ cat log

You'll see a bunch of escape sequences which represent the UI. On the other hand, redirecting stdout works perfectly:

$ vis > log

The only difference to vim here is that vim prints its UI to stdout. If you try the following

$ vim > log

vim will emit a warning and you got the same "problem".

TL;DR this is impossible to avoid with TUIs and not a real problem.

Docbroke commented 1 year ago

Thanks for your reply. So I just need to redirect stdout instead of stderr when trying to avoid error output.