-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
OSC52 panic #495
Comments
@unxed any chance of a fix for this one as well? |
Pls remind after 14th thanks! |
@unxed it's after the 15th |
And the popup has its own issue now: #497 |
Merci! Will look into the code now. |
@mgrant0 have problems reproducing. Can you please provide exact steps? Not very familiar with tmux, sorry! |
nothing happens |
In KiTTY, I have my terminal set in Connection/Data to In my .tmux.conf I have this to enable OSC-52 support:
then start tmux. Once in tmux, my $TERM looks like this:
If I double click a word, I get the KiTTY OSC popup, answering yes, the word is in the windows paste buffer. If I double click around enough, especially in an area where there's no text like below the prompt, KiTTY dies. |
Guess I am doing something wrong. |
Yes ~/.tmux.conf The terminal lines in my example are not matching your actual $TERM which is why your not seeing the copy action. I'll have to try this tonight, the correct lines need to match terminal type 'screen'. It took me some fiddling to get this to trigger the osc52 in kitty as you can see. If there's s better way, perhaps someone can chime in. Nothing that tmux sends back to KiTTY should kill it. We'll get it to reproduce for you somehow. |
Did you see your OSC52 popup? Which version are you running? I'm running the precompiled version from this page: https://www.fosshub.com/KiTTY.html I tried all 3, Classic, Portable, and No Compression. All 3 produce the effect for me. The Portable one produced this error before dying: I am very surprised you can't reproduce this. How is it possible for my setup to be different or non-standard? |
kitty_portable-0.76.1.12.exe Can you pls try to replace the code in terminal.c starting with
Added some checks that may help. |
Or you can try this precompiled binary: |
I tried your precopiled version. This version does not crash, good! But if the length of the string you get from the remote is zero length, then, I think you should clear the Windows copy buffer to be consistent. Also, can you remove the MesssageBox? Is this popup really necessary? Thank you for your work on this! |
No, don't do this. You're current version does the correct thing here. |
The code now checks for existence of environment variable OSC52ALLOWED. If it is set to any non-empty value, user will not be asked for confirmation any more.
|
Just for your interest. Since I practically did not have time to study this bug deeply, I entrusted the solution to ChatGPT 4, and it solved it on the first try. No changes were needed in generated code. Full conversation with ChatGPT (in Russian, but you can use Google Translate or in-browser translation): https://chat.openai.com/share/ee1d116b-1354-466a-8220-822ceeff0928 |
OMG, you used GPTChat to fix this, amazing. I did read the code quite carefully and it looks perfectly reasonable. Instead of depending on an environment variable, can you add an option to the KiTTY Configuration panel? |
I thought that if I can't reproduce the bug, maybe I could feed the code to a robot and see if it can find the problem. And it actually found it!
At least I can try :) Possibly we should discuss this with @cyd01 first. |
I think the configuration option would probably go under Windows->Behavior and be called "Warn before synchronizing clipboard" or if you prefer "Warn before OSC52 clipboard sync". |
To set an environment variable in Windows so that KiTTY can recognize it, you can follow these steps: Temporary (for current session):
Permanent (across sessions):
After setting the environment variable using one of the methods above, KiTTY should be able to access it. (this is also ChatGPT-generated answer) |
The env vars in the KiTTY configuration are set into the shell/program that is launched by the ssh command. I'll estimate that ssh -o "SetEnv ..." is used to set them. So the vars are not visible to the KiTTY Windows process. |
I enabled OSC52 support in tmux. I double-click on some text. I received the popup "allow OSC52 clipboard sync". The text is indeed copied to the clipboard. (marvellous!)
I do this one or two more times or so and then I receive this error (n.b. it may be that I am double clicking somewhere with little or no text):
KiTTY also seems just to quit without this error if I double-click on something which results in nothing being copied (as in, you have nothing selected and hit ctrl-c). In this case, you wouldn't touch the local clipboard at all. Same as if you selected nothing in Windows and hit ctrl-C then ctrl-V, you get what was previously in the clipboard, not an empty clipboard.
Is there an option (if not, please can we have an option?) to bypass the "allow OSC52 clipboard sync" popup? Or perhaps, replace this with one of those fading messages that you don't need to confirm, for example "Kitty set clipboard".
The text was updated successfully, but these errors were encountered: