-
Notifications
You must be signed in to change notification settings - Fork 621
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
fix: Ensure file paths are properly escaped during pasteboard paste operations #5036
fix: Ensure file paths are properly escaped during pasteboard paste operations #5036
Conversation
ac45070
to
45b472c
Compare
45b472c
to
39bb949
Compare
Ok so I don't know this code base enough to figure out if this also applies to linux (I searched and found bits of safepaste code, but I tested it, and it fails in exactly the same way. So I'd say: why not also fix this for linux? |
@Mil0dV I don't know if this issue exists for Linux. Can you reproduce the issue on Linux? That would be nice. Unfortunately, I can't because I don't use Linux, and the fix will likely involve very platform-specific changes. |
@AlexJuca ah my edit and your reply crossed eachother. Yes, I reproduced this on linux. Shouldn't the same Ghostty.Shell.escape() also work there, if the right file is found to insert it? |
This was recently added to the Zig code: Lines 9 to 41 in d1fd22a
It's not exposed to macOS at the moment though. |
This PR ensures file paths derived from pasteboard operations are properly escaped:
Before fix:
Attempting to cd into these paths rendered the following error:
cd: too many arguments
because the directory name includes spaces or special characters, which need to be handled correctly when running the cd command.Screen.Recording.2025-01-13.at.23.55.23.video-converter.com.mp4
Afer fix
File paths are now properly escaped and we can correctly
cd
into these paths.Screen.Recording.2025-01-13.at.23.58.00.video-converter.com.mp4
This change ensures Ghostty has the same behaviour as Iterm2.