13

I have a problem wherein I tried to get fancy with prompts, using ANSI colors. It works beautifully using 8/16 color palette ANSI sequences in tcsh and bash.

It works even more beautifully using 256 color palette ANSI sequences in tcsh.

It goes all out of whack using 256 color palette ANSI sequences in bash. All on RedHat linux.

So, what's the best site to post this kind of question on?

  • StackOverflow? (which has a bunch of programming questions on ANSI colors)?
  • Serverfault? (seems way wrong based on my limited knowledge of that site's scope)
  • Superuser? (seems best for bash stuff?)
  • Unix and Linux?
  • Other?
  • My psychic powers tell me that it's one of these: Your $TERM is wrong, your terminfo files are wrong (but not the older termcap files), screen or tmux is somehow to blame, or your terminal is one of those evil ones that pretends to be xterm without actually supporting xterm's capabilities correctly. – Kevin Jun 18 at 23:52
  • @Kevin - your psychic powers are wrong sorry. Actual answer (apparently someone asked already) was that it's a bug^H^H^H feature in bash, where ANSI characters confuse the terminal's line width calculation due to being unprintable; you have to square-brace escape them in the prompt. Oh, and it ONLY has an issue when the window is small, if you maximize it the issue goes away – DVK Jun 19 at 0:43
  • Out of curiosity, which site had the question that helped you solve your issue? – A C Jun 19 at 5:06
  • Don't remember off-hand but 90% it was this one (Unix) – DVK Jun 19 at 12:02
25

StackOverflow? (which has a bunch of programming questions on ANSI colors)?

No, since this is not a programming question, but a question about general computing software. It might be tolerated depending on who sees it, but I'd lean towards it being off-topic.

Serverfault? (seems way wrong based on my limited knowledge of that site's scope)

No, since this has nothing to do with professional system administration.

This should be on-topic on:

  • Unix & Linux
  • Super User
  • (if on Ubuntu, which you aren't) Ask Ubuntu

I'd say there are plenty of people here on U&L who know the intricacies of bash prompts and ANSI control codes, so U&L is as good a place to post this as any.

  • +1 for @muru' response. In fact I'd go one farther and suggest Unix & Linux under the shells, or better; bash Tags. :) – somebody Jun 15 at 8:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .