Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ttab

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ttab - npm Package Compare versions

Comparing version 0.8.0 to 0.9.0

8

CHANGELOG.md

@@ -7,2 +7,8 @@ # Changelog

* **[v0.9.0](https://github.com/mklement0/ttab/compare/v0.8.0...v0.9.0)** (2024-05-22):
* [enhancement] Thanks to [@HofiOne](https://github.com/HofiOne), `ttab` now supports new macOS-focused options, `-h`, `-v`, `-c`, and `-i`,
which notably includes support for splitting the current tab horizontally (`-h`) or vertically (`-v`) in iTerm2.
* [fix] Attempts to use options that are not supported in the target terminal now consistently result in errors.
* [breaking change] Since `-h` now requests horizontal splitting, it can no longer be used to invoke help; use `--help` instead.
* **[v0.8.0](https://github.com/mklement0/ttab/compare/v0.7.3...v0.8.0)** (2023-01-12):

@@ -21,3 +27,3 @@ * [enhancement] New `-l` option / env. var. `TTAB_CMD_DELAY` allows specifying a delay before submitting a startup command to a new tab, to accommodate shells whose initialization-file processing takes a while (iTerminal / iTerm2 only).

* **[v0.7.0](https://github.com/mklement0/ttab/compare/v0.6.1...v0.7.0)** (2020-08-24):
* [enhancement] Thanks to @ksvirsky, `ttab` is now also available on Linux, assuming `gnome-terminal` is available.
* [enhancement] Thanks to [@ksvirsky](https://github.com/ksvirsky), `ttab` is now also available on Linux, assuming `gnome-terminal` is available.

@@ -24,0 +30,0 @@ * **[v0.6.1](https://github.com/mklement0/ttab/compare/v0.6.0...v0.6.1)** (2017-11-08):

@@ -10,5 +10,11 @@ <!-- DO NOT EDIT THIS FILE: It is auto-generated by `make update-man` -->

ttab [-w] [-s <settings>] [-t <title>] [-q] [-g|-G] [-d <dir>] [<cmd> ...]
ttab [-w|-v|-h|-c] [-i] [-s <settings>] [-t <title>] [-q] [-g|-G] [-d <dir>] [<cmd> ...]
-w Open new tab in new terminal window.
-v iTerm only: create a new vertical split
-h iTerm only: create a new horizontal split
-c Terminal/iTerm only: do not open any new window or
tab, run in the current tab of the current window.
-i Suppress up-front verification of the existence of
the target directory specified via the -d option.
-s <settings> Assign a settings set (profile).

@@ -90,2 +96,24 @@ -t <title> Specify title for new tab.

* `-c`
Terminal/iTerm2 only:
does not create any new window or tab, and uses the current tab in the
front window.
This is primarily useful when launching this utility from a macOS service
or Shortcuts.app shortcut, for targeting the target terminal's current tab.
* `-h`
iTerm2 only:
creates a new horizontal split in the current tab.
* `-v`
iTerm2 only:
creates a (new) vertical split in the current tab.
* `-i`
suppresses up-front verification of the existence of the target directory
specified via the -d option.
This is primarily useful on macOS if this utility is launched from a
non-privileged session (e.g., a Shortcuts.app shortcut) that may not have
access to the target directory, whereas the targeted terminal may.
* `-s <settings>`

@@ -99,3 +127,3 @@ specifies the settings set (profile) to apply to the new tab, determining

is case-*sensitive*, and specifying a nonexistent profile causes an error.
o gnome-terminal: profiles are defined in Edit > Preferences; name matching
o gnome-terminal: profiles are defined in Edit > Preferences; name matching
is case-*sensitive*, and specifying a nonexistent profile falls back to

@@ -135,5 +163,5 @@ to the default profile.

NOTE: Terminal/iTerm2: With `-g` or `-G`, the new tab will still activate
NOTE: Terminal/iTerm2: With `-g` or `-G`, the new tab will still activate
*briefly, temporarily*, for technical reasons. The temporary activation
lasts as least as long as the effective -l value (command-submission
lasts as least as long as the effective -l value (command-submission
delay).

@@ -146,4 +174,5 @@

files that take a long time to process.
Note that setting a working dir. with -d alone requires a startup command,
and that in iTerm2 setting a working dir. is always required.
Note that setting a working dir. with -d alone entails execution of a
startup command (`cd`), and that in iTerm2 such a startup command is run
even by default, to ensure that the caller's working dir. is inherited.
The default is 0.1 secs; you can preset a different value via

@@ -164,3 +193,3 @@ environment variable TTAB_CMD_DELAY. Note the impact on -g / -G.

* `-h, --help`
* `--help`
Prints the contents of the synopsis chapter to stdout for quick reference.

@@ -191,2 +220,10 @@

# Open new horizontal split tab in the current terminal window:
ttab -h
# Open new vertical split tab in the current terminal window, changing
# the path to the given path, but without checking the presence of the
# target directory:
ttab -v -i -d "$HOME/Library/Application Support"
# Open new tab with title 'Green' using settings (profile) 'Grass':

@@ -212,1 +249,4 @@ ttab -t Green -s Grass

ttab -a iTerm2 echo "Hi from iTerm2."
# Execute the command in the current tab of the current terminal window:
ttab -c 'ls "$HOME/Library/Application Support"'

2

LICENSE.md

@@ -1,1 +0,1 @@

Copyright (c) 2015-2023 Michael Klement <mklement0@gmail.com> (http://same2u.net), released under the [MIT license](https://spdx.org/licenses/MIT#licenseText).
Copyright (c) 2015-2024 Michael Klement <mklement0@gmail.com> (http://same2u.net), released under the [MIT license](https://spdx.org/licenses/MIT#licenseText).

@@ -5,3 +5,3 @@ {

"private": false,
"version": "0.8.0",
"version": "0.9.0",
"os": [

@@ -59,5 +59,5 @@ "darwin",

"semver": "^4.2.0",
"tap": "^14.10.8",
"tap": "^18.5.1",
"urchin": "^0.0.5"
}
}

@@ -24,7 +24,7 @@ [![npm version](https://img.shields.io/npm/v/ttab.svg)](https://npmjs.com/package/ttab) [![license](https://img.shields.io/npm/l/ttab.svg)](https://github.com/mklement0/ttab/blob/master/LICENSE.md)

A CLI for Unix-like platforms that programmatically opening a new terminal tab/window in one of the following terminal applications, optionally with a command to execute and/or a specific title and specific display settings (profile).
A CLI for Unix-like platforms that programmatically opening a new terminal tab/window in one of the following terminal applications, optionally with a command to execute and/or a specific title and specific display settings (profile).
* On **[macOS](https://www.apple.com/macos)**: either `Terminal` (the default terminal emulator) or popular alternative [`iTerm2`](http://www.iterm2.com/).
* On **Linux**, [Gnome Terminal](https://help.gnome.org/users/gnome-terminal) (`gnome-terminal`), thanks to a contribution by [@ksvirsky](https://github.com/ksvirsky).
* Note: `ttab` does _not_ support **Windows**; consider using the [Windows Terminal](https://github.com/microsoft/terminal/blob/main/README.md)-based [`wttab`](https://github.com/lalilaloe/wttab) utility there.
- On **[macOS](https://www.apple.com/macos)**: either `Terminal` (the default terminal emulator) or popular alternative [`iTerm2`](http://www.iterm2.com/).
- On **Linux**, [Gnome Terminal](https://help.gnome.org/users/gnome-terminal) (`gnome-terminal`), thanks to a contribution by [@ksvirsky](https://github.com/ksvirsky).
- Note: `ttab` does _not_ support **Windows**; consider using the [Windows Terminal](https://github.com/microsoft/terminal/blob/main/README.md)-based [`wttab`](https://github.com/lalilaloe/wttab) utility there.

@@ -35,4 +35,4 @@ Note: `iTerm2` and `gnome-terminal` support is currently not covered by the automated tests run before every release.

**Important**: On macOS, irrespective of installation method, `Terminal` / `iTerm2` (`iTerm.app`) needs to be granted _access for assistive devices_ in order for `ttab` to function properly, which is a _one-time operation that requires administrative privileges_.
If you're not prompted on first run and get an error message instead, go to `System Preferences > Security & Privacy`, tab `Privacy`, select `Accessibility`, unlock, and make sure `Terminal.app` / `iTerm.app` is in the list on the right and has a checkmark.
**Important**: On macOS, irrespective of installation method, `Terminal` / `iTerm2` (`iTerm.app`) needs to be granted _access for assistive devices_ in order for `ttab` to function properly, which is a _one-time operation that requires administrative privileges_.
If you're not prompted on first run and get an error message instead, go to `System Preferences > Security & Privacy`, tab `Privacy`, select `Accessibility`, unlock, and make sure `Terminal.app` / `iTerm.app` is in the list on the right and has a checkmark.
For more information, see [Apple's support article on the subject](https://support.apple.com/en-us/HT202802).

@@ -45,13 +45,11 @@

```sh
curl -LO https://raw.githubusercontent.com/mklement0/ttab/master/ttab.rb &&
HOMEBREW_NO_AUTO_UPDATE=1 brew install --formula ttab.rb &&
rm ttab.rb
brew tap mklement0/ttab https://github.com/mklement0/ttab.git
brew install mklement0/ttab/ttab
```
<sup>Tip of the hat to [@dsingingwolfboy](https://github.com/singingwolfboy) for inspiring me to add this installation method and providing the original formula, and to [@leemm](https://github.com/leemm) for updating the instructions after Homebrew stopped supporting installing directly from an online `.rb` file.</sup>
Note:
* The Homebrew version may lag behind the npm registry version if later versions relate solely to the Linux-only Gnome Terminal functionality.
* To remove `ttab` later, run `brew rm ttab`.
- The Homebrew version may lag behind the npm registry version if later versions relate solely to the Linux-only Gnome Terminal functionality.
- To upgrade `ttab` to the latest version, run `brew upgrade ttab`.
- To remove `ttab` later, run `brew rm ttab`.

@@ -66,10 +64,10 @@ ## Installation from the npm registry

* Whether you need `sudo` depends on how you installed Node.js and whether you've [changed permissions later](https://docs.npmjs.com/getting-started/fixing-npm-permissions); if you get an `EACCES` error, try again with `sudo`.
* The `-g` ensures [_global_ installation](https://docs.npmjs.com/getting-started/installing-npm-packages-globally) and is needed to put `ttab` in your system's `$PATH`.
- Whether you need `sudo` depends on how you installed Node.js and whether you've [changed permissions later](https://docs.npmjs.com/getting-started/fixing-npm-permissions); if you get an `EACCES` error, try again with `sudo`.
- The `-g` ensures [_global_ installation](https://docs.npmjs.com/getting-started/installing-npm-packages-globally) and is needed to put `ttab` in your system's `$PATH`.
## Manual installation
* Download [this `bash` script](https://raw.githubusercontent.com/mklement0/ttab/stable/bin/ttab) as `ttab`.
* Make it executable with `chmod +x ttab`.
* Move it to a folder in your `$PATH`, such as `/usr/local/bin`.
- Download [this `bash` script](https://raw.githubusercontent.com/mklement0/ttab/stable/bin/ttab) as `ttab`.
- Make it executable with `chmod +x ttab`.
- Move it to a folder in your `$PATH`, such as `/usr/local/bin`.

@@ -85,2 +83,9 @@ # Examples

# Open new horizontal split tab in the current terminal window:
ttab -h
# Open new vertical split tab in the current terminal window, changing the path to the
# given path, but without checking the presence of the target directory:
ttab -v -i -d "$HOME/Library/Application Support"
# Open a new tab and execute the specified command before showing the prompt.

@@ -90,3 +95,3 @@ ttab ls -l "$HOME/Library/Application Support"

# Open a new tab and execute the specified command *after a delay* of 0.8 secs,
# to accommodate shells with lengthy initialization-file processing.
# to accommodate shells with lengthy initialization-file processing.
# Note: You may preset the delay via environment variable TTAB_CMD_DELAY

@@ -99,5 +104,5 @@ ttab -l 0.8 ls -1

# Open a new tab, switch to the specified dir., then execute the specified
# Open a new tab, switch to the specified dir., then execute the specified
# command before showing the prompt.
ttab -d ~/Library/Application\ Support ls -1
ttab -d ~/Library/Application\ Support ls -1

@@ -119,2 +124,5 @@ # Open a new tab with title 'How Green Was My Valley' and settings 'Grass'.

ttab -a iTerm2 echo 'Hi from iTerm2.'
# Execute the command in the current tab of the current terminal window:
ttab -c 'ls "$HOME/Library/Application Support"'
```

@@ -135,5 +143,11 @@

ttab [-w] [-s <settings>] [-t <title>] [-q] [-g|-G] [-d <dir>] [<cmd> ...]
ttab [-w|-v|-h|-c] [-i] [-s <settings>] [-t <title>] [-q] [-g|-G] [-d <dir>] [<cmd> ...]
-w Open new tab in new terminal window.
-v iTerm only: create a new vertical split
-h iTerm only: create a new horizontal split
-c Terminal/iTerm only: do not open any new window or
tab, run in the current tab of the current window.
-i Suppress up-front verification of the existence of
the target directory specified via the -d option.
-s <settings> Assign a settings set (profile).

@@ -167,9 +181,14 @@ -t <title> Specify title for new tab.

Copyright (c) 2015-2023 Michael Klement <mklement0@gmail.com> (http://same2u.net), released under the [MIT license](https://spdx.org/licenses/MIT#licenseText).
Copyright (c) 2015-2024 Michael Klement <mklement0@gmail.com> (http://same2u.net), released under the [MIT license](https://spdx.org/licenses/MIT#licenseText).
## Acknowledgements
A thank you to all contributors to this repo, especially the following major ones:
* [@ksvirsky](https://github.com/ksvirsky)
* [@HofiOne](https://github.com/HofiOne)
This project gratefully depends on the following open-source components, according to the terms of their respective licenses.
[npm](https://www.npmjs.com/) dependencies below have optional suffixes denoting the type of dependency; the *absence* of a suffix denotes a required *run-time* dependency: `(D)` denotes a *development-time-only* dependency, `(O)` an *optional* dependency, and `(P)` a *peer* dependency.
[npm](https://www.npmjs.com/) dependencies below have optional suffixes denoting the type of dependency; the _absence_ of a suffix denotes a required _run-time_ dependency: `(D)` denotes a _development-time-only_ dependency, `(O)` an _optional_ dependency, and `(P)` a _peer_ dependency.

@@ -197,2 +216,8 @@ <!-- DO NOT EDIT THE NEXT CHAPTER and RETAIN THIS COMMENT: The next chapter is updated by `make update-readme/release` with the dependencies from 'package.json'. ALSO, LEAVE AT LEAST 1 BLANK LINE AFTER THIS COMMENT. -->

* **[v0.9.0](https://github.com/mklement0/ttab/compare/v0.8.0...v0.9.0)** (2024-05-22):
* [enhancement] Thanks to [@HofiOne](https://github.com/HofiOne), `ttab` now supports new macOS-focused options, `-h`, `-v`, `-c`, and `-i`,
which notably includes support for splitting the current tab horizontally (`-h`) or vertically (`-v`) in iTerm2.
* [fix] Attempts to use options that are not supported in the target terminal now consistently result in errors.
* [breaking change] Since `-h` now requests horizontal splitting, it can no longer be used to invoke help; use `--help` instead.
* **[v0.8.0](https://github.com/mklement0/ttab/compare/v0.7.3...v0.8.0)** (2023-01-12):

@@ -211,3 +236,3 @@ * [enhancement] New `-l` option / env. var. `TTAB_CMD_DELAY` allows specifying a delay before submitting a startup command to a new tab, to accommodate shells whose initialization-file processing takes a while (iTerminal / iTerm2 only).

* **[v0.7.0](https://github.com/mklement0/ttab/compare/v0.6.1...v0.7.0)** (2020-08-24):
* [enhancement] Thanks to @ksvirsky, `ttab` is now also available on Linux, assuming `gnome-terminal` is available.
* [enhancement] Thanks to [@ksvirsky](https://github.com/ksvirsky), `ttab` is now also available on Linux, assuming `gnome-terminal` is available.

@@ -214,0 +239,0 @@ * **[v0.6.1](https://github.com/mklement0/ttab/compare/v0.6.0...v0.6.1)** (2017-11-08):

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc