Detect if your code is running inside a tmux session, and if so, which pane
$ npm install --save is-tmux
const isTmux = require('is-tmux');
console.log(isTmux.default); // Prints true in tmux, false otherwise
console.log(isTmux.pane()); // Prints pane number in tmux (e.g. "%138"), undefined otherwise
Copyright © 2018, nukeop. Released under the MIT License.