-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kitty with tmux passthrough only works if kitty +icat
was invoked before
#195
Comments
This will be because you havent enabled tmux passthrough. icat does that for you if needed, automatically. I am guessing chafa doesnt. |
Greetings, Kovid. First of all, thank you for bringing kitty and calibre to us! May I ask whether this is something I have to configure on |
tmux |
TL;DR: add Thanks for the quick answer. Solved! Related tmux doc here. |
Chafa is supposed to set the tmux option automatically. The relevant code is here: https://github.com/hpjansson/chafa/blob/master/tools/chafa/chafa.c#L1818-L1904 It will only do so if it thinks it's not already set, and if it makes any changes, will restore the option to its original value afterwards. There's likely something going wrong with this code; maybe we're being too conservative when detecting whether it's already set, you're running Chafa in a remote session where it's unable to set the option, or there's a bug. FWIW it works here, so I need some more info. @ronyclau What's the output if you revert your configuration to the state where Chafa doesn't work, and run |
Without the config, After From the code block you linked, some observations:
To dig a bit deeper, I enabled tmux's verbose mode with an empty config file ( Test 1
Result$ grep cmd_unpack_argv tmux-server-428170.log
1711392694.170651 cmd_unpack_argv: argv[0]=show
1711392694.170654 cmd_unpack_argv: argv[1]=allow-passthrough
1711392702.054822 cmd_unpack_argv: argv[0]=set
1711392702.054826 cmd_unpack_argv: argv[1]=allow-passthrough
1711392702.054829 cmd_unpack_argv: argv[2]=on Test 2
Result$ grep cmd_unpack_argv tmux-server-426090.log No matching line implies that the tmux server didn't receive any command from the I would suggest checking whether |
Thanks for the thorough analysis!
To shed some light on what the exec calls are doing (if anything), could you please run:
|
Sure thing. I am running this with the $ strace -f -e trace=execve,read chafa --passthrough=tmux -f kitty red.png 2>&1 | grep 'allow-passthrough\|exited'
[pid 637726] +++ exited with 0 +++
[pid 637725] +++ exited with 0 +++
[pid 637724] +++ exited with 0 +++
[pid 637723] +++ exited with 0 +++
[pid 637722] +++ exited with 0 +++
[pid 637721] +++ exited with 0 +++
[pid 637720] +++ exited with 0 +++
[pid 637719] +++ exited with 0 +++
[pid 637718] +++ exited with 0 +++
[pid 637717] +++ exited with 0 +++
[pid 637716] +++ exited with 0 +++
[pid 637715] +++ exited with 0 +++
[pid 637714] +++ exited with 0 +++
[pid 637713] +++ exited with 0 +++
[pid 637712] +++ exited with 0 +++
[pid 637711] +++ exited with 0 +++
[pid 637710] +++ exited with 0 +++
[pid 637709] +++ exited with 0 +++
[pid 637708] +++ exited with 0 +++
[pid 637707] +++ exited with 0 +++
[pid 637706] +++ exited with 0 +++
[pid 637705] +++ exited with 0 +++
[pid 637704] +++ exited with 0 +++
[pid 637703] +++ exited with 0 +++
[pid 637702] +++ exited with 0 +++
[pid 637701] +++ exited with 0 +++
[pid 637700] +++ exited with 0 +++
[pid 637699] +++ exited with 0 +++
[pid 637698] +++ exited with 0 +++
[pid 637697] +++ exited with 0 +++
[pid 637696] +++ exited with 0 +++
[pid 637695] +++ exited with 0 +++
+++ exited with 0 +++ |
Are you running the remote ssh session inside tmux, or tmux inside the ssh session? If the former, there are two issues with it:
|
This prevents setting the passthrough option needlessly. See #195 (GitHub).
I'll assume this issue resulted from running in an ssh session where tmux could not be detected nor manipulated. In that case there's no more to do in this issue, so I'm closing it. Please correct me if this is wrong. Thanks for all the feedback! |
This prevents setting the passthrough option needlessly. See #195 (GitHub).
Problem
No image is shown when
chafa
is called in a tmux pane in whichkitty +icat
has never been called.Reproduction steps
Assuming that an image named
red.png
is in the current directory,chafa --passthrough tmux -f kitty red.png
. Black space of correct height is printed instead of the image.kitty +icat red.png
. (Any image would do actually.)chafa --passthrough tmux -f kitty red.png
again. The image would be displayed as expected.Example image
Expected result
The image should be displayed regardless of whether
kitty +icat
has been invoked before.Environment
chafa 1.14.0
tmux 3.4
kitty 0.32.2
The text was updated successfully, but these errors were encountered: