hnarayanan/shpotify

'spotify quit' quits closes terminal window as well

ryanyz10 opened this issue · 5 comments

Some weird behavior I've bee running into: 'spotify quit' also closes my terminal window that I'm working in. Is this expected behavior or a bug?

Shell is zsh, terminal is iTerm2.

kapture 2018-04-11 at 15 51 09

It is not the intended behaviour, and I am not able to reproduce it in my setup (where it simply closes spotify as it should). I am running zsh on Apple's default Terminal.app.

Maybe it's a problem with iTerm then, I'll see if I can look into it but I don't know much, if any, shell.

Edit: I changed the "exit 1" to "break" in the case (switch?) statement where all the commands are handled and it seems to still work fine.

In iTerm2 v3.1.6 using bash shell, spotify quit does not close iTerm2. So it's possibly a combination of iTerm2 and zsh, but it could also be something with @ryanyz10 specific terminal/shell settings.

I recently merged a PR that prompted me to review and clean up the use of breaks and exits.

This particular case, I've used exit 0 as technically that's what this shell script should do when attempting to quit the Spotify app.

Hopefully this fixes your case too.

I ran into this issue yesterday using the built in terminal app on macOS running zsh. I used @ryanyz10 's fix and made a gif of it in case anyone else runs into this issue.

shpotifyQuitFix