poyashad / display-aws-amplify-env-vscode-extension

This extension displays the current name of the local Amplify environment in the status bar of VS code. If you click on the extension in the status bar, you can change the environment graphically. This extension also notifies you with an information message when you change the environment.
https://marketplace.visualstudio.com/items?itemName=poyashad.display-aws-amplify-environment
Other
5 stars 0 forks source link

Using commands from the extension should not create a new terminal screen everytime #2

Closed abdallahshaban557 closed 2 years ago

abdallahshaban557 commented 2 years ago

Hi @poyashad ,

It would be great if while using commands from the extension, that a new terminal screen would not be created every single time.

You can see in the source code it uses vscode.window.createTerminal to run the Amplify CLI. Instead maybe you could run the command as a child process of the extension.

import * as cp from "child_process";

const execShell = (cmd: string) =>
    new Promise<string>((resolve, reject) => {
        cp.exec(cmd, (err, out) => {
            if (err) {
                return reject(err);
            }
            return resolve(out);
        });
    });

Here is a Stackoverflow post with the same issue https://stackoverflow.com/questions/43007267/how-to-run-a-system-command-from-vscode-extension

poyashad commented 2 years ago

Hi @abdallahshaban557, with this new update. if you change the environment, the extension uses a child process. Thank you very much for pointing this out! As for the other commands in the extension. They show a lot of information that I think is useful to the user, but let me know what you think! Thanks for your feedback demo1

abdallahshaban557 commented 2 years ago

Thank you, Poya! Loving this new feature! Closing this request out!