Please provide setting option add the start-up Commands for the Machines #10848

Closed
opened 2026-01-31 02:31:51 +00:00 by claunia · 3 comments
Owner

Originally created by @jiveshwar on GitHub (Oct 1, 2020).

Please add the option to add some startUpCommands in each machine, such as:

{
	"guid": "{95ca431a-2vw37-1fb3-1hcf-sjd84745465}",
	"name": "Kali-Linux",
	"hidden": false,
	"startUpCommands": "ssh myServer;cd /var/logs/test;"
},
{
	"guid": "{95ca431a-2vw37-1fb3-1hcf-sjd84745466}",
	"name": "Kali-Linux-2",
	"hidden": false,
	"startUpCommands": "cd /var/git-repo;git pull;"
},
Originally created by @jiveshwar on GitHub (Oct 1, 2020). Please add the option to add some **startUpCommands** in each machine, such as: { "guid": "{95ca431a-2vw37-1fb3-1hcf-sjd84745465}", "name": "Kali-Linux", "hidden": false, "startUpCommands": "ssh myServer;cd /var/logs/test;" }, { "guid": "{95ca431a-2vw37-1fb3-1hcf-sjd84745466}", "name": "Kali-Linux-2", "hidden": false, "startUpCommands": "cd /var/git-repo;git pull;" },
claunia added the Issue-QuestionArea-SettingsResolution-AnsweredProduct-Terminal labels 2026-01-31 02:31:52 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Oct 1, 2020):

You mean like maybe, the commandline property?

Ah okay, I see what you're trying to do. You're trying to ssh directly to a specific directory on the remote machine. That's unfortunately really hard to do (for whatever reason). This thread might have some suggestions for you: https://github.com/MicrosoftDocs/terminal/issues/25#issuecomment-631515603

@zadjii-msft commented on GitHub (Oct 1, 2020): ~~You mean like maybe, the [`commandline` property](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/profile-settings#command-line)?~~ Ah okay, I see what you're trying to do. You're trying to ssh directly to a specific directory on the remote machine. That's unfortunately really hard to do (for whatever reason). This thread might have some suggestions for you: https://github.com/MicrosoftDocs/terminal/issues/25#issuecomment-631515603
Author
Owner

@jiveshwar commented on GitHub (Oct 1, 2020):

You mean like maybe, the commandline property?

Ah okay, I see what you're trying to do. You're trying to ssh directly to a specific directory on the remote machine. That's unfortunately really hard to do (for whatever reason). This thread might have some suggestions for you: MicrosoftDocs/terminal#25 (comment)

Thanks for the reply. I actually want something similar to shell script to work in this field value. I have updated my question for a better visibility.

@jiveshwar commented on GitHub (Oct 1, 2020): > ~You mean like maybe, the [`commandline` property](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/profile-settings#command-line)?~ > > Ah okay, I see what you're trying to do. You're trying to ssh directly to a specific directory on the remote machine. That's unfortunately really hard to do (for whatever reason). This thread might have some suggestions for you: [MicrosoftDocs/terminal#25 (comment)](https://github.com/MicrosoftDocs/terminal/issues/25#issuecomment-631515603) Thanks for the reply. I actually want something similar to shell script to work in this field value. I have updated my question for a better visibility.
Author
Owner

@DHowett commented on GitHub (Oct 1, 2020):

The explanation is the same for running a shell script as it is for changing to a directory. https://github.com/MicrosoftDocs/terminal/issues/25#issuecomment-631515603 is going to be your best bet.

Terminal isn't intending on supporting "startup commands" -- they're fragile and prone to failure, because they are pretty much always implemented by pretending that the user typed that command when they launch a new tab. There's far better ways to run commands on startup: passing them as arguments, writing script wrappers, putting startup actions in your shell profile (.bashrc, profile.ps1, etc.), etc.

@DHowett commented on GitHub (Oct 1, 2020): The explanation is the same for running a shell script as it is for changing to a directory. https://github.com/MicrosoftDocs/terminal/issues/25#issuecomment-631515603 is going to be your best bet. Terminal isn't intending on supporting "startup commands" -- they're fragile and prone to failure, because they are pretty much always implemented by pretending that the user typed that command when they launch a new tab. There's far better ways to run commands on startup: passing them as arguments, writing script wrappers, putting startup actions in your shell profile (`.bashrc`, `profile.ps1`, etc.), etc.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10848