Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[bash] pb avec la longueur de la ligne [Résolu]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
Zanton
Apprentice
Apprentice


Joined: 16 Jan 2005
Posts: 277

PostPosted: Thu May 05, 2005 2:46 pm    Post subject: [bash] pb avec la longueur de la ligne [Résolu] Reply with quote

J'étais en train de retoucher mon .bashrc pour mettre des couleurs attrayantes ^^ Malheureusement, une fois parvenu au résultat désiré, force est de constater que le nombre de caractères que je peux écrire sur une ligne à mystérieusement changé... Au delà de 51 caractères, la suite des caractères est écrite au début de la ligne, par dessus le prompt chose qui ne m'arrivait jamais auparavant. Je joins mon .bashrc, si jamais une bonne âme sait comment résoudre ce petit problème.

Code:
# /etc/skel/.bashrc:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/skel/.bashrc,v 1.8 2003/02/28 15:45:35 azarah Exp $

# This file is sourced by all *interactive* bash shells on startup.  This
# file *should generate no output* or it will break the scp and rcp commands.

# On établit la liste des couleurs
rouge='\e[0;31m'
ROUGE='\e[1;31m'
bleu='\e[0;34m'
BLEU='\e[1;34m'
cyan='\e[0;36m'
CYAN='\e[1;36m'
NC='\e[0m'
marron='\e[0;33m'
MARRON='\e[1;33m'
gris='\e[1;30m'
GRIS='\e[0;30m'
violet='\e[0;35m'
VIOLET='\e[1;35m'
#MARRON='\[\033[0;33m\]'

# set a fancy prompt
PS1="$BLEU[$cyan\u$BLEU@$cyan\h:\w$BLEU] $cyan\$ $NC"

# colors for ls, etc.
eval `dircolors -b /etc/DIR_COLORS`
alias d="ls --color"
alias ls="ls --color=auto"
alias l="ls --color -l"

# Change the window title of X terminals
case $TERM in
   xterm*|mrxvt|Eterm|eterm)
      PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
      ;;
   screen)
      PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\033\\"'
      ;;
esac

##uncomment the following to activate bash-completion:
#[ -f /etc/profile.d/bash-completion ] && source /etc/profile.d/bash-completion

_________________
Zanton


Last edited by Zanton on Thu May 05, 2005 10:06 pm; edited 1 time in total
Back to top
View user's profile Send private message
titix
Guru
Guru


Joined: 01 Nov 2003
Posts: 343
Location: Paris, France

PostPosted: Thu May 05, 2005 3:02 pm    Post subject: Reply with quote

J'ai eu le même problème sur des serveurs debian depuis tout type de terminaux, xterm comme putty, je n'ai jamais pu l'expliquer.
J'ai toujours penser à un bug ou à une incompatibilité.
Point commun entre ton bashrc et mes problèmes passés, les couleurs, regarde de ce côté.
_________________
titix
« La route est longue... mais la voie est libre ! »
Back to top
View user's profile Send private message
Trevoke
Advocate
Advocate


Joined: 04 Sep 2004
Posts: 4099
Location: NY, NY

PostPosted: Thu May 05, 2005 3:03 pm    Post subject: Reply with quote

Il me semble que c'est parce que les caracteres que tu utilises pour les couleurs modifient la longueur de la ligne, eux aussi.
Je ne sais pas comment le reparer, ca me le fait parfois mais pas tout le temps.
_________________
Votre moment detente
What is the nature of conflict?
Back to top
View user's profile Send private message
Steelskin
Tux's lil' helper
Tux's lil' helper


Joined: 02 May 2005
Posts: 105

PostPosted: Thu May 05, 2005 4:13 pm    Post subject: Reply with quote

Ce sont les définitions des couleurs qui sont mauvaises, par exemple, au lieu de :
Code:
rouge='\e[0;31m'

Mets :
Code:
rouge='\[\e[0;31m\]'


Et idem pour toutes les autres.
_________________
Kupo !
Back to top
View user's profile Send private message
Zanton
Apprentice
Apprentice


Joined: 16 Jan 2005
Posts: 277

PostPosted: Thu May 05, 2005 10:05 pm    Post subject: Reply with quote

Merci, c'était exactement ça :)
_________________
Zanton
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum