Skip to content

Re-run command is backed up by one sequence with shell integration #202299

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

Closed
anthonykim1 opened this issue Jan 12, 2024 · 3 comments
Closed

Re-run command is backed up by one sequence with shell integration #202299

anthonykim1 opened this issue Jan 12, 2024 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug terminal-shell-integration Shell integration infrastructure, command decorations, etc. verified Verification succeeded
Milestone

Comments

@anthonykim1
Copy link
Contributor

Tested on MacOS
(Shell integration for Windows Python REPL users are still colorless so could not test for Windows)

With shell integration decoration enabled on Mac and Linux users using Python REPL, I found out pressing re-run via the decoration offered commandline that is one before the appropriate/target commandline.

For example, clicking on decoration on print('hello') should've offered print('hello') after "Do you want to run the command: ", but instead offered a command that is one before.

Screenshot 2024-01-11 at 2 00 04 PM

(When debugging after clicking decoration circle) command.command in the _getCommandAction function seemed to also command that is one before the appropriate/target command.

Screenshot 2024-01-11 at 4 11 03 PM

Debugging with breakpoint on line 479 (

currentCommand.command = this._hooks.isCommandStorageDisabled ? '' : this._terminal.buffer.active.getLine(currentCommand.commandStartMarker.line)?.translateToString(true, currentCommand.commandStartX, currentCommand.commandRightPromptStartX).trim();
) showed empty string for currentCommand.command.

@Tyriar Tyriar added this to the February 2024 milestone Feb 1, 2024
@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug terminal-shell-integration Shell integration infrastructure, command decorations, etc. labels Feb 1, 2024
@Tyriar Tyriar modified the milestones: February 2024, March 2024 Feb 20, 2024
@anthonykim1
Copy link
Contributor Author

Fixed by: microsoft/vscode-python#23025

@roblourens
Copy link
Member

With shell integration decoration enabled on Mac and Linux users using Python REPL

How do I enable that? I don't see shell integration inside the repl

@roblourens
Copy link
Member

Oh, I do see it when I start the repl with the "Start REPL" command

@roblourens roblourens added the verified Verification succeeded label Mar 26, 2024
@microsoft microsoft locked and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug terminal-shell-integration Shell integration infrastructure, command decorations, etc. verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants