what a rabbithole. lots of goodies now.
This commit is contained in:
@@ -16,12 +16,10 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
package terminal
|
||||
|
||||
import (
|
||||
"os"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// IsShell returns true if the program is running inside an interactive shell (interactive invocation, sudo, etc.), and false if not (cron, ssh exec, pipe, etc.).
|
||||
@@ -32,8 +30,8 @@ func IsShell() (interactive bool) {
|
||||
|
||||
stdoutStat, _ = os.Stdout.Stat()
|
||||
|
||||
if (stdoutStaf.Mode() & os.ModeCharDevice) != 0 {
|
||||
interactive = True
|
||||
if (stdoutStat.Mode() & os.ModeCharDevice) != 0 {
|
||||
interactive = true
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user