hbang / NewTerm

NewTerm is a terminal emulator app with first-class iPhone, iPad, and Mac support.
https://newterm.app
Other
464 stars 71 forks source link

Shortcuts integration #67

Open kirb opened 3 years ago

kirb commented 3 years ago

Implement a shortcut to execute a script:

Think about how we can do this securely to avoid abuse, such as a user downloading a malicious shortcut and executing it without checking its contents first. e.g. Require the user to flick a switch to enable shortcuts first.

hnlkaitan commented 3 years ago

Just saw your email, thank you so much! I actually also just ran into something else that partially made me ask this in the first place; if I could make a feature request, would it be possible to enable these actions to be run from an Apple Watch and push the command to the paired phone (for example, if my phone's unresponsive, run a Shortcut on my watch that sends killall -9 backboardd to my phone).

I know there are a lot of things to consider regarding this (especially since you're still working on getting these implemented in the first place) or even if this possible from a technical standpoint but if this could be taken a look at some time down the road that'd be great!

Also, I know that some Actions can't be run on Apple Watch: for example, the Get Clipboard action can't be run (I'm not sure exactly what decides this though). If you open a Shortcut → ⋮ it'll say below the Show on Apple Watch toggle which actions in that Shortcut can't be run.

TheAwesome98-Real commented 3 years ago

if my phone's unresponsive, run a Shortcut on my watch that sends killall -9 backboardd to my phone.

This is a good idea, I also want this

zanodor commented 1 year ago

Shortcut integration workaround:

  1. Use a LocalSSH action to edit .zshrc file with commands to execute on startup, 2. run NewTerm, 3. last action: delete last line you put in .zshrc file.