Terminal.app & Screen

Discussion in 'macOS' started by Chilz0r, Aug 14, 2008.

  1. Chilz0r macrumors regular

    Joined:
    Jul 20, 2007
    #1
    Hey all,

    I installed screen via MacPorts and whenever I start screen up it
    displays 'bash-3.2$ ' rather than the usual export PS1="\h\W \u$"
    format I get from Terminal.app by default. I know this sounds trivial
    but I'd really appreciate it if I could get the same format happening
    in screen.

    TIA.
     
  2. Chilz0r thread starter macrumors regular

    Joined:
    Jul 20, 2007
    #2
    Any unix guru's out there that can help me :eek: pretty please!!!
     
  3. cristo macrumors regular

    Joined:
    Aug 16, 2008
    #3
    Is this not just set up in the terminal preferences?
     
  4. r0k macrumors 68040

    r0k

    Joined:
    Mar 3, 2008
    Location:
    Detroit
    #4
    create the file .bashrc in your home directory and insert the following:

    Code:
    PS1='\h:\W \u\$ '
    From now on, every bash shell will get the prompt you prefer.
     
  5. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #5
    Why did you need that? You do realise that Terminal allows you multiple tabs don't you? Just press :apple: + T to open a new Terminal tab.
     
  6. darwinian macrumors 6502a

    darwinian

    Joined:
    Jan 4, 2008
    Location:
    In R4, more or less
    #6
    Once you create the aforementioned .bashrc, also create a .bash_profile and a .profile that reads:

    source .bashrc

    Then you won't have to worry about startup order, etc. in bash run in screen terminals.
     
  7. bplein macrumors 6502

    bplein

    Joined:
    Jul 21, 2007
    Location:
    Austin, TX USA
    #7
    The application called "screen" allows you to start a command line application and have it run, even if you disconnect your terminal session. It runs in a virtual tty. There are MANY uses for such a virtual terminal that can't be replicated by the GUI Terminal application.
     
  8. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #8
    Hmm, sounds interesting. Not sure I'd have a use myself for that kind of thing. Cheers for pointing that out.
     
  9. bplein macrumors 6502

    bplein

    Joined:
    Jul 21, 2007
    Location:
    Austin, TX USA
    #9
    Mostly I've used it on servers that are remote, such as at a colocation. SSH into the system, start a screen, start a long running process inside the screen, and disconnect. Connect later and check the progress.
     
  10. Chilz0r thread starter macrumors regular

    Joined:
    Jul 20, 2007
  11. r0k macrumors 68040

    r0k

    Joined:
    Mar 3, 2008
    Location:
    Detroit
    #11
    I didn't know about the tabs. I've been using visor. I hit ctrl-tab to get a semi-transparent terminal window to pop down. Now that I've seen the tabs, I'm tempted to use a regular terminal with multiple tabs. BTW, I did notice that my .bashrc did NOT get sourced for every new tab I opened. It was simple enough to type bash in each new tab to get it sourced but it bothered me that it didn't get sourced to begin with.
     

Share This Page