awrit
awrit copied to clipboard
Warn if trying to use through tmux/screen
A user reported that it failed with a vague error message but they apparently were using tmux which is not supported.
Before starting, awrit should check if the Kitty graphics protocol is supported and exit with a message saying that it isn't supported in tmux, screen or other terminals that don't support the Kitty graphics protocol
It seems kitty graphics protocol now supports running inside tmux. At least timg supports it.
In order to use Kitty graphics protocol under tmux, it seems you have to use passthrough mode. https://github.com/kovidgoyal/kitty/blob/ce2e1b08132831fe770ec48d1e73eb4edd21c5b5/kittens/icat/transmit.go#L38-L43
See man tmux for detail:
OPTIONS
...
Available server options are:
...
allow-passthrough [on | off]
Allow programs in the pane to bypass tmux using a terminal escape sequence (\ePtmux;...\e\\).
Actually, Virtual Placements (Unicode Placeholders; the recent addition for multiplexer support) might not even be required for the use case of this project, since, in particular, the terminal screen will actually never be scrolled while running awrit.
Just wrapping the current graphics control sequences being used with the passthrough might be sufficient to make things work in tmux and screen and is worth giving a try first.
By the way, I recall they both have length limits for their passthrough payloads (at least, for screen). Hence, the graphics sequences might have to be chucked.
Anyone got luck on make it work on Tmux?
In my current setup if I run kitten icat img.png inside tmux it works as expected, but when I try to execute awrit it shows a bunch of "BAD SIZE 1908360" messages, even having set -g allow-passthrough on in my .tmux.conf.
Yes, I have gotten the old version to work, can't even get electron to work normally.
Hey @TogiFerretFerret , which version are you using? Also, what did you do to make it work?
Hey @TogiFerretFerret , which version are you using? Also, what did you do to make it work?
He's referring to v1.0.0 on the main branch. Using awrit through tmux isn't supported.
On that note, this can probably be closed:
https://github.com/chase/awrit/blob/electron/src/index.ts#L79-L89