Jump to content

Terminal Action repeats when opening new tabs


benptooey

Recommended Posts

When using a Terminal Action in a workflow, the Terminal app is started and the command run successfully. If, however, a new tab is started with cmd-T or through the Terminal "Shell" menu, the command that Alfred originally sent to Terminal is run again in the new tab.

 

Cheers,

 

-Ben

Link to comment
Share on other sites

When using a Terminal Action in a workflow, the Terminal app is started and the command run successfully. If, however, a new tab is started with cmd-T or through the Terminal "Shell" menu, the command that Alfred originally sent to Terminal is run again in the new tab.

 

Cheers,

 

-Ben

 

Whoa, this is definitely interesting and may very well be a bug in Terminal.app itself! I'll see what I can do with the AppleScript to work around this issue :)

Link to comment
Share on other sites

  • 1 year later...

Saw this and had to comment. See this screenshot of Terminal's preferences.

ztvedw.png

OS X's default is that New tabs open with: Same Settings. This means that if, for example, you began a terminal session by SSH'ing into another machine, a new tab will also attempt to SSH into that machine. To alleviate this behavior, switch it to Default Settings.

Link to comment
Share on other sites

Saw this and had to comment. See this screenshot of Terminal's preferences.

 

OS X's default is that New tabs open with: Same Settings. This means that if, for example, you began a terminal session by SSH'ing into another machine, a new tab will also attempt to SSH into that machine. To alleviate this behavior, switch it to Default Settings.

 

Nicely spotted, cheers!

Link to comment
Share on other sites

At the risk of hijacking this thread, would you know if it's possible to open a new Terminal tab from directly from Alfred? The Run Terminal Command action always opens a new terminal windows. I currently have a hacked-together AppleScript workaround that involves delays but I'd prefer an official solution if it's possible.

Link to comment
Share on other sites

At the risk of hijacking this thread, would you know if it's possible to open a new Terminal tab from directly from Alfred? The Run Terminal Command action always opens a new terminal windows. I currently have a hacked-together AppleScript workaround that involves delays but I'd prefer an official solution if it's possible.

 

You can customise Alfred's terminal AppleScript or even create new workflow actions to perform specific actions such as this... it might be worth asking in the workflow help sub-forum instead of the bugs/investigating sub-forum as I'm sure some other users are already doing this :)

 

By default, Alfred takes the most robust / predictable approach by opening a brand new window each time as that way, you can guarantee the state of the window rather than running a command in an unpredictable window.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...