Add an option for a non-login shell to be run (#192)

* Add an option for a non-login shell to be run

By default, however, the user's login shell will be used

* Reset shell default to empty string, and improve documentation
This commit is contained in:
Mike 2016-07-17 15:05:08 -06:00 committed by Guillermo Rauch
parent 2ecc23fe1f
commit 8164d673e0
3 changed files with 10 additions and 4 deletions

View file

@ -46,7 +46,11 @@ module.exports = {
'#cc00ff',
'#00ffff',
'#ffffff'
]
],
// the shell to run when spawning a new session (i.e. /usr/local/bin/fish)
// if left empty, your system's login shell will be used by default
shell: ''
},
// a list of plugins to fetch and install from npm

View file

@ -82,7 +82,9 @@ app.on('ready', () => {
});
rpc.on('new', ({ rows = 40, cols = 100, cwd = process.env.HOME }) => {
initSession({ rows, cols, cwd }, (uid, session) => {
const shell = cfg.shell;
initSession({ rows, cols, cwd, shell }, (uid, session) => {
sessions.set(uid, session);
rpc.emit('session add', {
uid,

View file

@ -18,9 +18,9 @@ const TITLE_POLL_INTERVAL = 500;
module.exports = class Session extends EventEmitter {
constructor ({ rows, cols: columns, cwd }) {
constructor ({ rows, cols: columns, cwd, shell }) {
super();
this.pty = spawn(defaultShell, ['--login'], {
this.pty = spawn(shell || defaultShell, ['--login'], {
columns,
rows,
cwd,