Skip to content

Commit

Permalink
fix: detect zsh when zsh isnt run as a login prompt (yargs#1395)
Browse files Browse the repository at this point in the history
  • Loading branch information
forivall authored and bcoe committed Aug 20, 2019
1 parent 28e600c commit 8792d13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/completion.js
Expand Up @@ -8,7 +8,8 @@ module.exports = function completion (yargs, usage, command) {
completionKey: 'get-yargs-completions'
}

const zshShell = process.env.SHELL && process.env.SHELL.indexOf('zsh') !== -1
const zshShell = (process.env.SHELL && process.env.SHELL.indexOf('zsh') !== -1) ||
(process.env.ZSH_NAME && process.env.ZSH_NAME.indexOf('zsh') !== -1)
// get a list of completion commands.
// 'args' is the array of strings from the line to be completed
self.getCompletion = function getCompletion (args, done) {
Expand Down

0 comments on commit 8792d13

Please sign in to comment.