Skip to content

Conversation

etherandrius
Copy link

@etherandrius etherandrius commented Sep 19, 2025

Description

Enabling the terminal command for all remotes; I'm pretty sure this is no longer needed?

The fallback says it's not enabled because it does not work for SSH but at the same time the feature is explicitly enabled for ssh-remote

See definition of vscode.env.remoteName

        /**
         * The name of a remote. Defined by extensions, popular samples are `wsl` for the Windows
         * Subsystem for Linux or `ssh-remote` for remotes using a secure shell.
         *
         * *Note* that the value is `undefined` when there is no remote extension host but that the
         * value is defined in all extension hosts (local and remote) in case a remote extension host
         * exists. Use {@link Extension.extensionKind} to know if
         * a specific extension runs remote or not.
         */
        export const remoteName: string | undefined;

Summary by cubic

Enables terminal command execution across all environments by removing remoteName gating and using a single spawn-based path. SSH, WSL, Dev Containers, Codespaces, and local now get live output, background support, and clear status messages.

  • New Features

    • Works across all remote names (SSH, WSL, Dev Containers, Codespaces, etc.).
    • Streaming output, background mode, and waitForCompletion supported everywhere.
    • Color-capable environment applied to all runs.
  • Refactors

    • Removed ENABLED_FOR_REMOTES and ide.runCommand fallback; unified on child_process.spawn.
    • Dropped util.promisify/exec and unused imports.
    • Safer cwd resolution (workspace → home → process.cwd → os.tmpdir) and better process cleanup.

@etherandrius etherandrius requested a review from a team as a code owner September 19, 2025 17:26
@etherandrius etherandrius requested review from RomneyDa and removed request for a team September 19, 2025 17:26
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Sep 19, 2025
import iconv from "iconv-lite";
import childProcess from "node:child_process";
import os from "node:os";
import util from "node:util";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not used

Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


agrabauskas seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

} from "../../util/processTerminalStates";
import { getBooleanArg, getStringArg } from "../parseArgs";

const asyncExec = util.promisify(childProcess.exec);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not used

const ideInfo = await extras.ide.getIdeInfo();
const toolCallId = extras.toolCallId || "";

if (ENABLED_FOR_REMOTES.includes(ideInfo.remoteName)) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actual change is removing this if.

All lines below are just indentation changes

Comment on lines -433 to -444
// For remote environments, just run the command
// Note: waitForCompletion is not supported in remote environments yet
await extras.ide.runCommand(command);
return [
{
name: "Terminal",
description: "Terminal command output",
content:
"Terminal output not available. This is only available in local development environments and not in SSH environments for example.",
status: "Command failed",
},
];
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing fall-back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant