mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-16 05:38:41 -09:00
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:
parent
2ecc23fe1f
commit
8164d673e0
3 changed files with 10 additions and 4 deletions
|
|
@ -46,7 +46,11 @@ module.exports = {
|
||||||
'#cc00ff',
|
'#cc00ff',
|
||||||
'#00ffff',
|
'#00ffff',
|
||||||
'#ffffff'
|
'#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
|
// a list of plugins to fetch and install from npm
|
||||||
|
|
|
||||||
4
index.js
4
index.js
|
|
@ -82,7 +82,9 @@ app.on('ready', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
rpc.on('new', ({ rows = 40, cols = 100, cwd = process.env.HOME }) => {
|
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);
|
sessions.set(uid, session);
|
||||||
rpc.emit('session add', {
|
rpc.emit('session add', {
|
||||||
uid,
|
uid,
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@ const TITLE_POLL_INTERVAL = 500;
|
||||||
|
|
||||||
module.exports = class Session extends EventEmitter {
|
module.exports = class Session extends EventEmitter {
|
||||||
|
|
||||||
constructor ({ rows, cols: columns, cwd }) {
|
constructor ({ rows, cols: columns, cwd, shell }) {
|
||||||
super();
|
super();
|
||||||
this.pty = spawn(defaultShell, ['--login'], {
|
this.pty = spawn(shell || defaultShell, ['--login'], {
|
||||||
columns,
|
columns,
|
||||||
rows,
|
rows,
|
||||||
cwd,
|
cwd,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue