mklement0 / ttab

macOS and Linux CLI for opening a new terminal tab/window, optionally with a command to execute and/or display settings
283 stars 16 forks source link

No longer working in iTerm2 #39

Open markclaxton opened 2 years ago

markclaxton commented 2 years ago

I'm using iTerm2 version 3.4.12.

When I run my script the parameters of the script are changed during the process.

Screenshot 2021-11-19 at 12 26 59

Above is the image of the current output. The task is supposed to run a 'npm run serve' command. However, the directory is changed when the script is run. There's a semicolon after the user directory /users/USERNAME/folder/folder; npm run serve

mklement0 commented 2 years ago

I'm running the same version, and I don't see this symptom.

That the command shows up multiple times and prints what look like ANSI escape sequences verbatim is definitely strange.

Is there something usual about your environment? Do you have software installed that hooks into your terminals, such as Fig?

markclaxton commented 2 years ago

I am indeed using Fig. Although I can run the same commands in the standard macOS Terminal app without issue, and with this is with Fig enabled.

markclaxton commented 2 years ago

Ok, so I booted up my mac this morning, tried running the scripts again and ... it is working but with some differences in the output.

Screenshot 2021-11-22 at 09 41 21
mklement0 commented 2 years ago

I think that ttab is neither to blame here, nor do I think it can work around the issue.

It simply synthesizes an AppleScript behind the scenes and executes that.

You can make that script visible if you place the (undocumented) --print-script option first on the command line. To print the script only, without actually creating a new tab, use --dry-run.

I've just installed the latest Fig and it definitely lacks stability (I'm on an older macOS version, macOS 10.15.7).

Aside from outright crashes, I've only seen one strange symptom, which differs from yours: intermittently, the specified startup command for the new tab gets ignored.

I suggest you start with creating an issue in the Fig repo, at https://github.com/withfig/fig/issues. You can make it easier for them by boiling it down to an osascript -e call with the source code produced by --dry-run.