Allan, I know you made the change to call bash sub-shells with '--login' in response to people's problems getting their PATHs set straight, but I'd like to make an argument towards putting it back the way it was.
Philosophically, it's just not how things are supposed to work with bash. The reason .bash_profile is only called on a login shell, .bashrc is only called on an interactive non-login shell, and BASH_ENV is consulted for non-interactive shells is so that you can separate initialization code for these very different conditions.
Practically, since, by default, .bash_profile is only called on a login shell, people use it to put initialization code that should only be run when they log in ... knowing that that's the only time it will run. For example, people output stuff to the screen, they mess with their stty settings to get their keyboard working correctly, etc. People don't typically protect any of that stuff in if statements so that it only runs if there is a tty because ... there should always be one in a login shell.
By changing TextMate to use a login shell, it now executes all that cruft in the subshell. Every time I run a command it now inserts into the TextMate buffer all this extra stuff from my .bash_profile that I've sent to the screen, and errors from my trying to run stty without a tty. To combat that, I'm going to have to go through my .bash_profile and surround any of that kind of code with if statements that test if there is a tty or not.
So, in trying to make things easier for people (not having to set BASH_ENV in their enviroment) I think this is going to wind up making it harder for people (having to escape code with if statements all through their .bash_profile). I would bet that you'll start to see a lot of problems come in related to this.
What are your thoughts? Any chance I can convince you to change your mind on this?
Thanks much.
Greetings all from a new user.
I totally concur with Chris, as a long time bash user what he described is the correct behavior and assumptions concerning bash (and others). The man page for bash also describes this expectation.
On Tue, 2 Nov 2004 20:21:34 +0100, Allan Odgaard allan@macromates.com wrote:
I agree with you -- I'll change it back for beta 3 and instead include a note about how to setup BASH_ENV on OS X.
You, sir, are the man.
May I suggest, if you haven't already seen it, taking a look at:
Mac OS X: Runtime Configuration: Environment Variables http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Concepts/EnvironmentVars.html
Because of the way the login process works in Mac OS X, setting BASH_ENV in just your bash init scripts may not have an effect in the environment in which TextMate runs. Folks may have to set it in the ~/.MacOSX/environment.plist file as described in the above page, or use a utility like RCEnvironment http://www.rubicode.com/Software/RCEnvironment/ to do it.
Thanks for listening!
I seem to be having a terrible time getting my match pattern to work for Forth syntax coloring. FYI, in Forth the only delimiter between words are space|tab. Trying to setup a pattern to highlight comparision words for example I have: { name = "Comparision Operators"; fontStyle = (bold); foregroundColor = "#0066CC"; match = "\s(and|or|xor|0=|0>|0<|0<>|\s>\s|<|<>|=|u<|u>)\s"; },
Where I am trying to say find a space followed by one of the following words followed by white space.
But in my test file only some of the words are highlighted when all of them should be as in the following example. What am I doing wrong?
On 2. Nov 2004, at 21:11, Dave Carlton wrote:
Where I am trying to say find a space followed by one of the following words followed by white space.
But in my test file only some of the words are highlighted when all of them should be as in the following example. What am I doing wrong?
Your pattern “eats” the space before and after the keyword. So there will be no space left for the next keyword (which needs to be prefixed by one).
You can change the last “\s” to “(?=\s)”, which just ensures there's a space after the keyword, but doesn't eat it. Though it will still eat the first space (but if you follow this convention, eating the first, leaving the last, it should work).
Kind regards Allan
I'd like to second Chris' argument.
I'm a newbie to TextMate & commandlines and I'm learning by reading the man pages, of bash in particular. My definition of a hack is: Modifying one application (by adding 'if' statements to their .bash_profile) to make another work correctly.
I'm having a difficult enough of a time learning cli, I don't need to add to it.
-- Mr. Shannon Strachan
-----Original Message----- From: textmate-bounces@lists.macromates.com [mailto:textmate-bounces@lists.macromates.com]On Behalf Of Chris Brierley Sent: Tuesday, November 02, 2004 10:20 AM To: TM Users Subject: [TxMt] Making sub-shells login shells causes problems in thecurrent beta
Allan, I know you made the change to call bash sub-shells with '--login' in response to people's problems getting their PATHs set straight, but I'd like to make an argument towards putting it back the way it was.