-
Notifications
You must be signed in to change notification settings - Fork 30k
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
pwsh shell integration issues on Windows #155315
Comments
Oh, I had no idea about this. We haven't formalized the sequences yet so I wouldn't have recommended adopting them but kind of cool to see you did. Windows needs some special handling due to conpty so I'm not surprised it doesn't work. There are also some cases where it won't work until we get fixes from conpty (microsoft/terminal#8698). How does the Julia shell work exactly? Are you launching pwsh (as in the gifs above) or is it a julia repl? And if it's the former, why not call our shell-integration.ps1? (I know nothing about Julia 😅) |
Oh wow, I'm pretty sure I'm running into that order-of-operations issue too, judging by the
It's a Julia REPL; we're not going through any shell at all. I'm basically injecting the appropriate codes as prompt prefixes/suffixes and There's basically only the issue that Julia doesn't have the notion of a secondary prompt, so multi-line inputs directly into the REPL don't work properly. For inline evaluation (which also produces those result decorations in the editor) it works fine of course, because I can control what exactly is echo'ed into the terminal. I tried fixing that with |
Very cool 👍
Adding this will fix a bunch of problems you're seeing, currently we do some pretty terrible encoding of the message to support some special characters: vscode/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.ts Lines 377 to 382 in 8846ac5
This is one of the things that is expected to change when we formalize it. You will also want to make sure you send
This looks like a bug, we did just start sending the full command line via
I'll try remember to ping you when we tweak the protocol, if you're on Insiders you'll probably notice before it hits stable though. |
Also I'm guessing run recent command doesn't work for Julia, created #155530 as a follow up there |
Yup. It does work for the current session, of course, which is pretty cool already :) I'll implement the command passing (with escaping) and the One more thing -- let me know if you want me to open a separate issue -- is that the decoration is printed multiple times when the prompt is refreshed: |
PRs welcome for #155530 🙂, not totally sure how the keys should work here. We could go off the terminal name, that would separate for versions in the case of "Julia REPL (v1.8.0-rc3)", so maybe there should be a new shell integration sequence to indicate the shell type? 🤔
@pfitzseb that's definitely a bug, we've been trying to stamp out all possible cases where that happens but I guess the way you're sending the sequences is triggering it again. Are you by chance sending |
Actually it should still print, just without an exit code. Was it not going into this route? https://github.com/julia-vscode/julia-vscode/blob/048b836faf32036f867506eab88964660cc55405/scripts/packages/VSCodeServer/src/repl.jl#L81-L83
That would make sense, 633 C overwrites the command so E must come after. |
For the "empty command" part, you can turn on escape sequence logging and see how it works in bash/zsh for the ideal case |
I think this issue is resolved then, there are some known issues with windows and shell integration even on pwsh, some of which we can't fix right now. Please open an issue to track any you hit and feel free to reach out again with questions/clarifications regarding this stuff. |
It was. But that also happened for each refresh, so there would be many
Yeah, I can fix that, but I'm not sure I want to. It's kinda nice for
Will do, thanks a lot for your help! |
Maybe we should refine that behavior to skip empty commands, while still respecting ctrl/cmd+shift+up to select only the previous non-empty command's output. Without the empty commands it would also copy the extra prompts when copying output or selecting via command navigation. |
Created #155543 for polishing empty commands |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
Copy Output
andCopy Command
menu entries are missing in some casesCopy Output
may miss the last line of a multi-line outputCopy Output
for multi-line inputs may include part of the command (see last recording)As far as I can tell these issues are specific to Windows; shell integration works great on Linux with multiple shells. I ran into this because the Julia extension also injects the relevant CSI633 codes for the integrated REPL, but the VS Code UI is broken on Windows (which may entirely be due to Julia doing weird full-prompt refreshes on Windows or something like that, but could also be due to conhost or something).
1-69-1.webm
insiders.webm
multi-line.webm
The text was updated successfully, but these errors were encountered: