chase / awrit

A full graphical web browser for Kitty terminal with mouse and keyboard support
Other
454 stars 18 forks source link

Warn if trying to use through tmux/screen #14

Open chase opened 1 year ago

chase commented 1 year ago

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

amosbird commented 1 year ago

It seems kitty graphics protocol now supports running inside tmux. At least timg supports it.

aiotter commented 7 months ago

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\\).
AnonymouX47 commented 7 months ago

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.

ddiegosr commented 3 weeks ago

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.