bashrc_dispatch icon indicating copy to clipboard operation
bashrc_dispatch copied to clipboard

Use $- to determine if interactive

Open gaelicWizard opened this issue 4 years ago • 0 comments

Instead of checking for environment variable $PS1 (which could be blindly set by a user or script somewhere), ask Bash if it is interactive by interrogating $- automatic variable. If it contains 'i' then the shell was started interactively.

gaelicWizard avatar Jun 25 '21 17:06 gaelicWizard