Skip to content
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

shell integration onDidStart never stops #226871

Closed
justschen opened this issue Aug 27, 2024 · 4 comments
Closed

shell integration onDidStart never stops #226871

justschen opened this issue Aug 27, 2024 · 4 comments
Assignees
Labels
info-needed Issue requires more information from poster *not-reproducible Issue cannot be reproduced by VS Code Team member as described

Comments

@justschen
Copy link
Contributor

Testing #226655

tried testing onDidStartTerminalShellExecution with something simple like writing git status and running it (since it runs by default), but it never stops sending the text via sendText.

maybe this is intended since there is anexplicit onDidEndTerminalShellExecution, but can maybe specify in docs that these two go hand in hand (unless this is already something well known 🫨 )

@Tyriar
Copy link
Member

Tyriar commented Aug 27, 2024

@justschen not sure what you mean by but it never stops sending the text via sendText.?

@Tyriar Tyriar added the info-needed Issue requires more information from poster label Aug 27, 2024
@justschen
Copy link
Contributor Author

justschen commented Aug 27, 2024

hmm I actually cannot repro anymore...

for context, I was trying something along the lines of:

	vscode.window.onDidStartTerminalShellExecution(e => {
			if (e.execution.commandLine.value === 'git add .') {
				e.terminal.sendText('git commit -m "auto commit"');
			}
		}),

perhaps e.shellIntegration.executeCommand is the more correct one in this case anyways, but i'll continue playing around with it

@Tyriar
Copy link
Member

Tyriar commented Aug 27, 2024

@justschen my only guess is that commandLine.value may have been different in start and stop? Also something like this is how I would go about doing your example:

// end not start, destructuring
vscode.window.onDidEndTerminalShellExecution({ execution, shellIntegration } => {
    if (execution.commandLine.value === 'git add .') {
        // executeCommand instead of sendText
        shellIntegration.executeCommand('git commit -m "auto commit"');
    }
})

@Tyriar Tyriar added the *not-reproducible Issue cannot be reproduced by VS Code Team member as described label Aug 27, 2024
Copy link

We closed this issue because we are unable to reproduce the problem with the steps you describe. Chances are we've already fixed your problem in a recent version of VS Code. If not, please ask us to reopen the issue and provide us with more detail. Our issue reporting guidelines might help you with that.

Happy Coding!

@vs-code-engineering vs-code-engineering bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster *not-reproducible Issue cannot be reproduced by VS Code Team member as described
Projects
None yet
Development

No branches or pull requests

2 participants