-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
Terminal doesn't handle multiple OSC 1337 or OSC 7 escape sequences correctly #234332
Comments
I think the problem here is that we tie the cwd to the command being run, not the line range. Changing cwd inside a command like this isn't supported and I'm a little surprised to see it works in iTerm2, but I guess they just went the line route instead of linking it to the full execution. @rzhw have you read somewhere official that this is supposed to work? I think you stumbled upon some largely undefined behavior here. |
Ah, I wondered if the similar behavior with I haven't seen anything explicitly saying OSC 7 and OSC 1337 should support multiple subsequent calls, though my naive reading of iTerm2's docs for OSC 1337 and OSC 7:
And WezTerm's docs for OSC 7:
Seems to suggest nothing should prevent subsequent calls from working. |
The similar sequences in 633 were essentially "forked" to that one so that VS Code could have a more complete protocol for shell integration, as opposed to having the mix of 1337, 133, 7, etc. (for better or worse). 633 is mostly intended to only be used in VS Code or in close collaboration with our team for now. I think I'll close this as out of scope for now as currently we store the cwd against the execute and it would take a decent sized change to support this behavior which doesn't seem well defined. If the links are important I'd suggest to look into OSC 8 hyperlinks to provide consistent links across all terminals that support that feature |
Type: Bug
From VSCode:
test.py
, and follow the below instructions:OSC 1337:
OSC 7:
Run
python3 test.py
from the inbuilt terminal.Observe that Ctrl/Cmd+Click on
../test.py
opens test.py as expected.Uncomment the commented lines.
Run
python3 test.py
.Observe that Ctrl/Cmd+Click on
../test.py
does not open it. Instead, VSCode spins a while and then pops a file picker.Observe that Ctrl/Cmd+Click on
./test.py
opens test.py as expected.From iTerm2:
Run
python3 test.py
, with the lines either commented out or not.Observe that in both cases, Cmd+Click on
../test.py
and./test.py
open test.py as expected.This seems particularly notable as OSC 1337 is an iTerm2 proprietary escape sequence.
VS Code version: Code 1.95.3 (Universal) (f1a4fb1, 2024-11-13T14:50:04.152Z)
OS version: Darwin arm64 24.2.0
The text was updated successfully, but these errors were encountered: