[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Prompt con colores conflictivo



> Hola, desde hace tiempo me ocurría que en las consolas usando bash (sea en
> las 
> X o en consola real) al escribir una línea larga el texto aparecía encima
> de 
> la misma línea, sobreescribiéndola.
> 
> Hoy me han comentado que se debe a mi "colorido" prompt, que de alguna
> forma 
> la lía. Este era el prompt revelde:
> 
>    PS1="\033[36m\u@\h \w:\[\033[0m "
>    
> Y sin embargo, poniendo un prompt sencillito sin colores no ocurre el
> problema 
> del salto de línea:
> 
>    PS1='\u@\h\w: '
> 
> No obstante me fastidia no poder poner un color diferente sin que ocurra
> el 
> problema y he probado de todo sin éxito. Si alguien tiene interés le animo
> a 
> que añada el PS1 conflictivo a su .bashrc y compruebe el fallo cuando toca
> 
> saltar de línea. Y si encuentra una forma de mostrar colores como mi PS1 
> inicial pero haciendo bien el salto de línea... pues le agradecería que me
> lo 
> contase. :-)
> 
> Y si a alguien le ocurría lo mismo y no sabía porqué pues aquí tiene una 
> solución aunque "estéticamente simplificada".  ;-)
> 
> Saludos.
> 
hola,

prueba este:

PS1='\[\e[1;37m\]\u@\h:\w>\[\e[0m\]'


cabiando 1 y 37, obtienes diferentes backgrounds y foregrounds, además de
subrayados, etc, etc.

Yo tuve tu mismo problema en su día y creo que se debe al \033

Saludos.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------------------------------
La información contenida en este correo electrónico es privada y
confidencial. Cualquier uso, modificación, difusión y/o reproducción por
parte de cualquier persona distinta del destinatario está prohibida. Si Vd.
recibe este mensaje por error, por favor bórrelo y comuníquelo al remitente.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------------------------------

This e-mail and any attachments are confidential and intended solely
for the addressee and may also be privileged or exempt from disclosure
under applicable law. If you are not the addressee, or have received
this e-mail in error, please notify the sender immediately, delete it
from your system and do not copy, disclose or otherwise act upon any
part of this e-mail or its attachments..

Internet communications are not guaranteed to be secure or virus-free.
The Barclays Group does not accept responsibility for any loss arising
from unauthorised access to, or interference with, any Internet
communications by any third party, or from the transmission of any
viruses. Replies to this e-mail may be monitored by the Barclays
Group for operational or business reasons..

Any opinion or other information in this e-mail or its attachments
that does not relate to the business of the Barclays Group is personal
to the sender and is not given or endorsed by the Barclays Group.

Barclays Bank PLC.Registered in England and Wales (registered no. 1026167).
Registered Office: 1 Churchill Place, London, E14 5HP, United Kingdom.

Barclays Bank PLC is authorised and regulated by the Financial Services Authority.



Reply to: