Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Chilz0r

macrumors regular
Original poster
Jul 20, 2007
135
0
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.
 
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.
 
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.
 
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.

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.
 
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.

Hmm, sounds interesting. Not sure I'd have a use myself for that kind of thing. Cheers for pointing that out.
 
Hmm, sounds interesting. Not sure I'd have a use myself for that kind of thing. Cheers for pointing that out.

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.
 
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.

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.