Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There seems to be a connection between CodeRunner's console output and your actual terminal prompt script, that is, if such prompt code is sourced from e.g. ~/.bash_profile (which CodeRunner reads by default).

I have a pretty fancy (read: great) terminal prompt (screenshot|code) that seems to mess up CodeRunner's console output, leading to garbled [00m[00m[00m[00m[00m characters at the start everytime I run some code, even though it's error-free and regardless of language). I'm reluctant to change my prompt for the sake of getting rid of these annoying characters.

If I turn off Invoke bash in login mode when running code in CodeRunner's Advanced prefs, I'm seeing bash: source: No such file or directory instead…

So I'm stuck between a rock and a hard place, trying to get a clean console in CodeRunner…

How can this be fixed? (I've tried contacting the developer about this but I'm receiving no answer.)

share|improve this question
up vote 3 down vote accepted

The culprit probably is line 88 in your

trap 'echo -ne "\033[00m"' DEBUG

This will output an ANSI escape code to reset the colors and style before the output of every command.

From examining your bash script, this line seems to be unnecessary, because you are resetting the formatting at the end of your prompt here on line 76:

PS1="$status_style"'$fill \t\n'"$BY\$(__name_and_server)$Y\w$G\$(__git_prompt)$RESET$ "

I suggest you just remove line 88 and try it like that.

Somewhat unrelated to this problem, but I also suggest editing line 73 to the following:

local RESET="\[\033[0m\]"

This way you are truly resetting the ANSI styling, whereas before you were setting it to white.

share|improve this answer
The world would is a better place with helpful people like you, Gerry! Your help worked a treat! – Henrik Sep 14 '12 at 9:37

Your Answer


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.