diff --git a/scripts/tmopen.sh b/scripts/tmopen.sh --- a/scripts/tmopen.sh +++ b/scripts/tmopen.sh @@ -19,13 +19,15 @@ echo "${basename%.git}" | tr '.' '-' } -# Check if a parameter was provided -if [ -z "$1" ]; then +# Accept input from argument or stdin +if [ -n "$1" ]; then + input=$1 +elif [ ! -t 0 ]; then + read -r input +else echo "Usage: tmopen [session_name]" exit 1 fi - -input=$1 is_url=false # Check if the input is a URL