Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
OSX CLI for opening a new terminal tab/window, optionally with a command to execute and/or display settings
Contents
An OS X CLI for programmatically opening a new terminal tab/window in the standard terminal application, Terminal.app
,
or in popular alternative iTerm.app
, optionally with a command to execute and/or a specific title and specific display settings.
Note: iTerm.app
support is experimental in that it is currently not covered by the automated tests run before every release.
Important: Irrespective of installation method, Terminal.app
/ 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
With Node.js or io.js installed, install from the npm registry:
[sudo] npm install ttab -g
Note:
sudo
depends on how you installed Node.js / io.js and whether you've changed permissions later; if you get an EACCES
error, try again with sudo
.-g
ensures global installation and is needed to put ttab
in your system's $PATH
.bash
script as ttab
.chmod +x ttab
.$PATH
, such as /usr/local/bin
.# Open a new tab in the current terminal window.
ttab
# Open a new tab in a new terminal window.
ttab -w
# Open a new tab and execute the specified command before showing the prompt.
ttab ls -l "$HOME/Library/Application Support"
# 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
# Open a new tab with title 'How Green Was My Valley' (-t not supported in iTerm) and settings 'Grass'.
ttab -t 'How Green Was My Valley' -s Grass
# Open a new tab and execute the specified script before showing the prompt.
ttab /path/to/someScript
# Open a new tab, execute the specified script, and exit.
ttab exec /path/to/someScript
# Open a new tab, execute a command, wait for a keypress, and exit.
ttab eval 'ls "$HOME/Library/Application Support"; echo Press a key to exit.; read -rsn 1; exit'
Find concise usage information below; for complete documentation, read the manual online, or, once installed, run man ttab
(ttab --man
if installed manually).
$ ttab --help
Opens a new terminal tab or window in OS X's Terminal application or iTerm.
ttab [-w] [-s <settings>] [-t <title>] [-g|-G] [-d <dir>] [<cmd> [<arg>...]]
-w open new tab in new terminal window
-s <settings> assign a settings set (profile)
-t <title> specify title for new tab (not supported in iTerm)
-g create tab in background (don't activate Terminal/iTerm)
-G create tab in background and don't activate new tab
-d <dir> specify working directory
<cmd> [<arg>...] command to execute in the new tab
Standard options: --help, --man, --version, --home
Copyright (c) 2015-2016 Michael Klement mklement0@gmail.com (http://same2u.net), released under the MIT license.
This project gratefully depends on the following open-source components, according to the terms of their respective licenses.
npm 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.
Versioning complies with semantic versioning (semver).
v0.3.0 (2016-05-04):
iTerm.app
) added.v0.2.1 (2015-09-15):
v0.2.0 (2015-09-14):
eval
.man ttab
); if installed manually, ttab --man
shows a plain-text version. ttab -h
now only prints concise, single-page usage information.v0.1.8 (2015-09-11):
v0.1.7 (2015-06-26):
v0.1.6 (2015-06-01):
v0.1.5 (2015-06-01):
v0.1.4 (2015-06-01):
package.json
.make browse
now opens the GitHub repo in the default browser.v0.1.3 (2015-06-01):
v0.1.2 (2015-06-01):
v0.1.1 (2015-06-01):
v0.1.0 (2015-06-01):
FAQs
OSX CLI for opening a new terminal tab/window, optionally with a command to execute and/or display settings
The npm package ttab receives a total of 20,064 weekly downloads. As such, ttab popularity was classified as popular.
We found that ttab demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.