-
Notifications
You must be signed in to change notification settings - Fork 508
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
PSReadLine Prompt not showing up after F8 in SSH Remoting #2605
Comments
To add, if there is output, it will execute successfully. So: Which is another cosmetics thing, the first line of the output will get indented up to the prompt. |
@PowerCoder have you been able to successfully try the tab completion behavior outside of VSCode, or does this issue just appear when you are in VSCode? |
If I start PS7 on Windows, then use the Windows SSH client to go to the Linux box, start pwsh, tab completion will go correctly. If I start PS7 on Windows, then issue Enter-PSSession to go directly into the Linux PS shell, tab completion will append a backslash instead of a forward slash at the ends of every directory. My guess is that because the parent-session/host is a Windows PS, it will default to Windows-style (backslashes). Compatibility will then auto-correct them to forward slashes upon execution or further path traversal. This behavior is identical in both a standard PowerShell 7 host and the VSCode terminal host. Which means that particular issue likely belongs in the main PwSh repo. Thanks for helping me figure that one out. If I SSH first, then start pwsh, using F8 will postpone execution until I've exited the SSH session. This is likely works as designed, it being a shell within a shell and all. The "breaking" issue remains though. |
Another addition, I can queue commands up this way as well, since they don't execute until I press Enter.
Then, |
When I did an I can probably test that with an Out-File/Add-Content. I'll try tomorrow. |
@PowerCoder can you please open an issue over in https://github.com/PowerShell/PowerShell about:
This behavior like you said is by design because you've executed
|
Done and Done: Issue 12253 Thank you. Hope the second issue can now get a new tag though, having to constantly click in the terminal and press Enter before going back to my code gets old fast. Which reminds me:
If I check from a separate SSH session without pressing Enter:
In other words, the command is executed, but the terminal doesn't drop back to a prompt until I press Enter in it. So what would happen if I F8 on a line that stores a variable, then on a line that presents the value of that variable as output?
where the D represents the cursor, waiting for me to press Enter. Without doing so, I go to the second line:
Which confirms my earlier statement that I am not returned to a prompt when there is no output, but I am returned to a prompt when there IS output. And finally, what happens if I press something other than Enter while it waits?
That's about all the tests I can think of. |
@PowerCoder thanks for the detailed description, unfortunately I think we are still having some trouble understanding the problem, could you please provide a GIF or video of the behavior...thanks! |
I'll see if I can find something suitable to record and upload. In the meantime, I'll make another attempt. Given this statement: Expected behavior is when I execute it using F8, it pastes it into the Terminal window, executes it and returns to the prompt. Current behavior is when I execute it using F8, it pastes it into the Terminal window, executes it but doesn't return to the prompt. Instead, the cursor waits patiently in the Terminal window for me to press Enter before returning to the prompt. The conditions for me to reproduce it are:
|
@PowerCoder thanks, that clarifies the behavior for us |
You may also want to give this extension a try: |
@SeeminglyScience might want to take a look at this? Probably fixed with your PR. |
I don't know if this is actually supported by the devs at this point, since the whole SSH-thing is still new on Windows. So I'm asking here. If it is valid for a bug report, please tell me the info you need, since it concerns VSCode, PowerShell 7 across 2 systems.
I enabled PSRemoting from my Windows to my Linux box. Since it has no GUI, I figured I should do an Enter-PSSession in the VSCode terminal, then develop my code from VSCode.
There is some unexpected behavior. First, a cosmetics issue. Tab completion on filesystem paths will always show a backslash instead of a forward slash. So I type
/tm
, press TAB and it turns into/tmp\
. This does not happen if I first SSH to the Linux box and then start pwsh from its local shell. It is no problem, since it will automatically turn into a forward slash if I TAB-complete the next level.More importantly, if I select a line in VSCode and press F8 to execute it, two things happen. First, if there is no output, the line will be copied to the terminal but not executed. I need to manually press Enter in the terminal window in order to actually execute the code. This also happens on the last line of a multi-line block and with both settings of the focusonexecute setting. Windows/Unix line feed differences?
The text was updated successfully, but these errors were encountered: