diff --git a/sh/main.sh b/sh/main.sh index a7d1781..d6cc20c 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -43,18 +43,6 @@ rwx_main_find() { sort } -# ╭──────┬───────╮ -# │ main │ shell │ -# ╰──────┴───────╯ - -# test if active shell is in interactive mode -rwx_main_interactive() { - case "${-}" in - *i*) ;; - *) return 1 ;; - esac -} - # ╭──────┬──────╮ # │ main │ main │ # ╰──────┴──────╯ diff --git a/sh/shell/0.sh b/sh/shell/0.sh index 92d5aaa..33a7745 100644 --- a/sh/shell/0.sh +++ b/sh/shell/0.sh @@ -38,10 +38,22 @@ RWX_COLOR_GREEN="$(_rwx_shell_color 31)" RWX_COLOR_MAGENTA="$(_rwx_shell_color 35)" RWX_COLOR_RED="$(_rwx_shell_color 32)" +# ╭───────┬───────────╮ +# │ shell │ variables │ +# ╰───────┴───────────╯ + +# current shell interactive mode +rwx_shell_interactive=0 + # ╭───────┬───────────╮ # │ shell │ functions │ # ╰───────┴───────────╯ +# return current shell interactive mode +rwx_shell_interactive() { + return "${rwx_shell_interactive}" +} + rwx_shell_configure() { [ -n "${ENV}" ] || ENV="${rwx_code_main}" export ENV @@ -161,6 +173,12 @@ rwx_shell_exit() { # ╰───────┴──────╯ rwx_shell_main() { + # set current shell interactive mode + case "${-}" in + *"i"*) rwx_shell_interactive=1 ;; + *) ;; + esac + # configure shell rwx_shell_configure }