This repository has no description

termio: reimplement OSC 7 URI handling (#9193) master

This reimplements the MAC address-aware URI parsing logic used by the OSC 7 handler and adds an additional .raw_path option that returns the full, unencoded path string (including query and fragment values), which is needed for compliant kitty-shell-cwd:// handling. Notably, this implementation takes an options-based approach that allows these additional behaviors to be enabled at runtime. It also leverages two std.Uri.parse guarantees: 1. Return slices point into the original text string. 2. .raw components don't require unescaping (.percent_encoded does). The implementation is in a new 'os.uri' module because its now generic enough to not be hostname-oriented. We use os.uri.parseUri and its parsing options to reimplement our OSC 7 file-style URI handling. This has two advantages: First, it fixes kitty-shell-cwd scheme handling. This scheme expects the full, unencoded path string, whereas the file scheme expects normal URI percent encoding. This was preventing paths containing "special" URI characters (like "path?") from working correctly in our bash, zsh, and elvish shell integrations, which report working directories using the kitty-shell-cwd scheme. (fish uses file URIs, which work as expected.) Second, we can greatly simplify our hostname and path string handling because we can now rely on the "raw" std.Uri component form to always provide the correct representation. Lastly, this lets us remove the previous URI-related code from the os.hostname module, restoring its focus to hostname-related functions. See: #5289


+234 -362
4 changed files