-
Notifications
You must be signed in to change notification settings - Fork 394
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
Macro settings #103
Macro settings #103
Conversation
Allows for setting the theme and title for the terminal command. In the JSON settings for your cmd add theme and title like so "name": "My blog", "theme": "Grass", "title": "ssh connection to example.com", "cmd": "ssh username@blog.example.com"
By default shuttle open’s new commands in a new tab. These changes allow you to set flag “isNewTab”: “false” if set the command will open in the active tab. This is useful if you want to run a commonly used command in the existing ssh tab. { "name": "check shuttle process", "isNewTab": "false", "cmd": "ps aux | grep [s]sh” } With isNewTab set to false the command will run in your existing terminal tab and not a new one. I branched these changes off my terminal-themes as some of the code was reused.
@fitztrev This is on hold until the SQLite / applescript changes are in place. I wanted to chat about the implementation. The goal of this is to allow commands to run in the existing tab Not the new one. |
Should these be global preferences, as opposed to per-host? Maybe one setting
|
@fitztrev Here is my scenario: I have some scripts that I often run on this server and and I place these in shuttle: I'm basically treating the "hosts" in JSON as "commands". In JSON, with the "command", I'm specifying how terminal or iTerm will launch that "command": |
Perhaps the extra notation should be like this
so
would run command |
@thshdw Sounds good. Instead of So with your scenario, first you SSH into a host, then you want to run a command inside that session. To make sure that command gets sent to the right tab/window, maybe the applescript could first But I'm fine with your suggestion. The user can be responsible for how they choose to use it. |
@fitztrev with iTerm nightly you can do this applescript:
It may be possible but I don't see a way to select a tab by its name. If you could select by name, I think we would run into issues with non unique names. Maybe terminal window 5 has two tabs with name "foo". Adding these features does add some risk, in that it could be possible for a user to run a command on the wrong server. However shuttle would not come shipped with these directives in the JSON; users would have to manually enter these in. Then as you mention, the user can be responsible for how they choose to use it. Being able to manually set how a command launches makes shuttle very flexible. I think this flexibility outweighs the risk. Perhaps if these settings end up in master we can note the risk in the help section for these features something like... Note: adding We could also instruct users that run commands in existing windows to wrap those commands with some user input like this:
This way we have done our due diligence :-) |
@thshdw 👍 😄 |
By default shuttle opens new commands in a new tab. These changes allow you to set flag “isNewTab”:false” if set the command will open in the active tab. This is useful if you want to run a commonly used command in the existing ssh tab.
{
"name": "check ssh process",
"isNewTab": "false",
"cmd": "ps aux | grep [s]sh”
}
With isNewTab set to false the command will run in your existing terminal tab and NOT a new one. If this setting is omitted then commands will revert back to the default of opening in a new tab.
I branched these changes off my terminal-themes branch as some of the code was reused.