Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using the following options in order to launch a 'screen' session when I launch Terminal.app to my OSX Mountain Lion:

**~/.zshrc relevant option**
if [[ $STY = '' ]] then screen -UxR; fi # autoload screen

**~/.screenrc**
escape ^Bb
autodetach on
startup_message off # Turn off the splash screen
defscrollback 30000 # Use a 30000-line scrollback buffer

Then, when I launch the terminal and issue the 'who' command I see this:

➜  ~  who
atma     console  Aug  2 09:59 
atma     ttys000  Aug  2 11:32 
atma     ttys002  Aug  2 11:32 

The first line is the default 'ho-my-zsh' prompt.

I'm pretty sure there is a good explanation but out of curiosity why there are 2 tty's there and not 1? If I exit the screen, using the 'exit' command I get 1 console and 1 ttys:

Last login: Thu Aug  2 11:32:40 on ttys000
[screen is terminating]
➜  ~  who
atma     console  Aug  2 09:59 
atma     ttys000  Aug  2 11:32 

Shouldn't only 'console' be listed here?

Regards & thanks for your time!

share|improve this question
    
Actually, the console is always there, right from boot (or at least login). The ttys000 is your regular shell. It's pretty obvious given the login times. –  Daniel Beck Aug 4 '12 at 6:14

1 Answer 1

The mac has you log in and it counts as being logged in on the console device at 09:59am; The terminal starts up a login shell for the current user (on ttys000 at 11:32am) and screen starts up a login shell for the current user within its virtual terminal (on ttys002 also at 11:32am). So this seems perfectly normal. That should explain why when you exit screen you're still seeing the console and ttys000 login as active. You might like this brief explanation of /dev/console/ and the console app.

share|improve this answer
    
Hm, nice that makes sense... Thanks :-) –  atmosx Aug 14 '12 at 12:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.