planetscale / cli

The CLI for PlanetScale Database
https://planetscale.com/cli
Apache License 2.0
604 stars 51 forks source link

Disable custom signal handling if not on foreground #857

Closed dbussink closed 7 months ago

dbussink commented 7 months ago

If pscale is used in scripts with the explicit PSCALE_ALLOW_NONINTERACTIVE_SHELL env flag, disable the signal changes we do for making the shell work in interactive mode.

This check also needs to verify that all of stdin, stdout & stderr are a proper TTY and not just stdout, since if you pipe in only input for example we still need to disable this since there's no foregrounding.

Fixes #856