holzschu / a-shell

A terminal for iOS, with multiple windows
BSD 3-Clause "New" or "Revised" License
2.71k stars 117 forks source link

Crash in iOS 15 Shortcuts #285

Open system1system2 opened 3 years ago

system1system2 commented 3 years ago

I’m reporting this exclusively because the latest update (released 6h ago) reports an “iOS15 ready” status. Otherwise, I’d have no expectation that this would work until GA.

Steps to reproduce:

  1. Create a new Shortcut
  2. Set as first step “Receive URLs input from Share Sheet (if there’s no input Continue)”
  3. Set as second step “Execute shell command” with all default options:
    • Open the app to execute the commands? default
    • Keep going after an error: no
    • Show When Run: yes
  4. Add the first command: “python3 test.py Shortcut Input”

As soon as you try to exit the UI, for example by tapping on “My Shortcuts” or “Search for apps and actions”, Shortcuts will crash and the command at n4 will not be saved.

Variations of this flow produce the same result. For example, by assigning the “Shortcut Input” value to a custom variable “URL” via “Set Variable”, and then writing the command “python3 test.py URL” .

The crash happens both on iPhone and iPad updated to the latest iOS 15 beta.

holzschu commented 3 years ago

Hi, thanks for the detailed report. I'll have a look. But at first glance this seems like a problem inside the Shortcut app: at this point the code from a-Shell has not yet been executed. But it's still worth investigating.

personalizedrefrigerator commented 3 years ago

Variations of this flow produce the same result. For example, by assigning the “Shortcut Input” value to a custom variable “URL” via “Set Variable”, and then writing the command “python3 test.py URL” .

Concatenating text directly in the input box is buggy even in iOS 14.


This fails: text is concatenated directly in the input box

Error given: 5+4 command not found


This works: text is concatenated in a separate block

Shows expected result


Does something similar to the second work in iOS 15?

system1system2 commented 3 years ago

Same crash in iOS 15. I tried by concatenating Shortcut Input inside a text, and by assigning Shortcut Input to a variable first and then concatenating the variable inside a text.

And just to be clear: when I say "crash", I mean that the Shortcuts app is killed and you go back to the home screen.

system1system2 commented 3 years ago

I found a workaround that doesn't require any modification of the flow and no text concat:

  1. Create a new Shortcut and define a-Shell as very first step
  2. Detail the command you like to execute even if it's not correct/complete in the "Execute shell command". In my case: python3 test.py
  3. Add all necessary steps before the a-Shell step, basically rewriting the Shortcut as it was originally intended.
  4. Modify the second step to include the variable passed by the Share Sheet

That's it. This time, mysteriously, Shortcuts won't crash when you try to exit or execute the shortcut just created.

Technically, it's not a fix. Just a workaround. Not sure if we want to close this issue.