https://github.com/elrumordelaluz/iterm-tab
Open Item2 tab programatically from NodeJS
https://github.com/elrumordelaluz/iterm-tab
child-process iterm iterm2 terminal
Last synced: about 1 month ago
JSON representation
Open Item2 tab programatically from NodeJS
- Host: GitHub
- URL: https://github.com/elrumordelaluz/iterm-tab
- Owner: elrumordelaluz
- Created: 2018-07-24T10:13:47.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-09-07T08:58:51.000Z (about 5 years ago)
- Last Synced: 2025-06-30T05:03:38.170Z (4 months ago)
- Topics: child-process, iterm, iterm2, terminal
- Language: JavaScript
- Size: 7.81 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# iterm-tab
Open iterm tab and run a command programmatically
## Install
```
yarn add iterm-tab
```## Usage
```
const itermTab = require('iterm-tab')itermTab(`cd .. && echo "my command"`)
.then(() => console.log('yay'))
```## API
itermTab(command, options)
#### command
The command to execute after open the new tab
Type: `String`
#### options
Type: `Object`
##### options.close
Closes tab immediately or after n seconds. Useful to launch persistent services like `mongod`.
Type: `Boolean|Number`
Default: `false`
##### options.delayAfterRun
Wait number of seconds before let continue the tasks.
Type: `Number`
Default: `0`
##### options.splitTab
Split the current tab horizontally or vertically then run the command.
Type: `Boolean|String`
Default: false
For Vertical Split: `{ splitTab: 'vertically' }`
For Horizontal Split: `{ splitTab: 'horizontally' }`
## Example
Take a look into [this example](https://github.com/elrumordelaluz/iterm-tab/blob/master/test.js) running two instances of `iterm-tab`