Skip to content
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

Handle # and ? characters in directory path #6171

Merged
merged 1 commit into from
Sep 21, 2024
Merged

Handle # and ? characters in directory path #6171

merged 1 commit into from
Sep 21, 2024

Conversation

loops
Copy link
Contributor

@loops loops commented Sep 21, 2024

When referencing the current-working-directory, before it is set by an OSC 7 escape sequence, we ask the OS for the correct path. This path was then being parsed as a URL; where a "#" or "?" character would be
interpreted as the start of a fragment or query
component of a URL -- which is a mistake.

So this change parses the returned directory as such, where those characters will be treated as a normal character in the path.

Nothing is changed for the OSC 7 escape sequence case. In that case, the application must percent-encode the path before sending, so that those characters are not misinterpreted.

As per issue #6158 reported by Syntaxheld

Copy link
Owner

@wez wez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

mux/src/localpane.rs Outdated Show resolved Hide resolved
When referencing the current-working-directory, before
it is set by an OSC 7 escape sequence, we ask the OS
for the correct path.  This path was then being parsed
as a URL; where a "#" or "?" character would be
interpreted as the start of a fragment or query
component of a URL -- which is a mistake.

So this change parses the returned directory as such,
where those characters will be treated as a normal
character in the path.

Nothing is changed for the OSC 7 escape sequence case.
In that case, the application must percent-encode the
path before sending, so that those characters are not
misinterpreted.

As per issue wez#6158 reported by Syntaxheld
@wez wez merged commit c63195f into wez:main Sep 21, 2024
14 of 15 checks passed
@wez
Copy link
Owner

wez commented Sep 21, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants