• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is a tty (or terminal)  RSS feed

 
Leslie Chaim
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I test if my System.out is connected to at tty or console/terminal/screen?
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand the quesion exactly - on linux the console/terminal is called 'tty'.
I'm curious why you wan't to know, but I think, after looking into the docs, you may not find out, to what it is bound (file, tty, /dev/null, ...).
 
Leslie Chaim
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll clarify my question with a perl snippet :roll:

The -t STDOUT returns true if the standard output is a screen or tty/console blah, blah, blah.
I'm looking for the equivalent in Java.
Specifically, I want to provide a progress report of my application if the user is running it from the command line
I hope that it�s cleared up now
Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!