tty --help
Usage: tty [OPTION]...
Print the file name of the terminal connected to standard input.
-s, --silent, --quiet print nothing, only return an exit status
--help display this help and exit
--version output version information and exit
Therefore when tty -s is executed it returns nothing
I thought maybe in a script it would not show any output but the return code would contain the value it would normally show. I tested that but it doesn’t. Just shows a 0 return.
Pls let me try your suggestions in both environments, GUI and server.
I am using the Window Terminal available by default on Ubuntu Desktop and Fedora Workstation. So not server environment, but it is going to be test it.