Skip to content

termio: don't require RFC 1123 hostnames in OSC 7 - #14971

Open
jcollie wants to merge 1 commit into
ghostty-org:mainfrom
jcollie:osc7-hostname-validation
Open

jcollie wants to merge 1 commit into
ghostty-org:mainfrom
jcollie:osc7-hostname-validation

Conversation

@jcollie

@jcollie jcollie commented Oct 31, 2026

Copy link
Copy Markdown
Member

The Zig 0.17 port switched reportPwd from uri.getHost to std.Io.net.HostName.fromUri, which also validates the host as an RFC 1123 hostname. Local hostnames often aren't: macOS allows names like "Foo's MacBook Pro", some systems use underscores, and our URI parser deliberately accepts MAC addresses. Any OSC 7 report from such a machine was dropped, so new tabs, splits and windows stopped inheriting the working directory.

The host only has to match the local hostname, which isLocal already checks, so extract it without validating it, as 1.3 did.

Fixes: #14970
Ref: #14952

AI disclosure: Claude Code was used in the preparation of this PR.

@jcollie
jcollie requested a review from a team as a code owner October 31, 2026 03:05
@jcollie jcollie added this to the 1.5.0 milestone Oct 31, 2026
@mitchellh

Copy link
Copy Markdown
Contributor

Some failing CI.

The Zig 0.17 port switched reportPwd from `uri.getHost` to
`std.Io.net.HostName.fromUri`, which also validates the host as an
RFC 1123 hostname. Local hostnames often aren't: macOS allows names
like "Foo's MacBook Pro", some systems use underscores, and our URI
parser deliberately accepts MAC addresses. Any OSC 7 report from such
a machine was dropped, so new tabs, splits and windows stopped
inheriting the working directory.

The host only has to match the local hostname, which `isLocal` already
checks, so extract it without validating it, as 1.3 did.

Fixes: ghostty-org#14970
Ref: ghostty-org#14952
@jcollie
jcollie force-pushed the osc7-hostname-validation branch from bd223c5 to f7b25c8 Compare October 31, 2026 05:44
@jcollie
jcollie enabled auto-merge October 31, 2026 05:45

This branch has not been deployed

No deployments
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.

macOS: new window, tab or split does not inherit current working directory

2 participants