[ZSH] Prompt qui disfonctionne [résolu]

Xorg, Compiz, KDE / Gnome / Xfce / Fluxbox / e17 / fvwm ... GDM/KDM/XDM...
Avatar de l’utilisateur
Piczel
Chu Ko Nu
Messages : 314
Inscription : dim. 03 mai 2015, 19:17
Localisation : Terre du Milieu

[ZSH] Prompt qui disfonctionne [résolu]

Message par Piczel »

Bonjour tout le monde, j'avais un prompt zsh personnalisé qui marchait super bien, pis l'autre jour j'ai reformaté mon ordi (windows qui partaient en chipolatas), et là, j'ai remis mon ancien prompt, mais il y a un passage qui marche plus.. le voici :

Code : Tout sélectionner

prompt_elite_help () {
  cat <<EOH
This prompt is color-scheme-able.  You can invoke it thus:

  prompt elite [<text-color> [<punctuation-color>]]

The default colors are red and blue respectively.  This theme is
intended for use with a black background.

Recommended fonts for this theme: either UTF-8, or nexus or vga or similar.
If you don't have any of these, the 8-bit characters will probably look
stupid.
EOH
}

prompt_elite_setup () {
  local text=${1:-'red'}
  local punctuation=${2:-'blue'}

  local -A schars
  autoload -Uz prompt_special_chars
  prompt_special_chars

  PS1="%F{$text}$schars[332]$schars[304]%F{$punctuation}(%F{$text}%n%F{$punctuation}@%F{$text}%m%F{$punctuation})%F{$text}-%F{$punctuation}(%~)%F{$text}$schars[304]$prompt_newline%F{$text}$schars[300]$schars[304]%F{$punctuation}(%F{$text}%D{%H:%M%P}%F{$punctuation}-:-%F{$text}%D{%m}%F{$punctuation}%F{$text}/%D{%d}%F{$punctuation})%F{$text}$schars[304] %f"
  PS2="> "

  prompt_opts=(cr subst percent)
}

prompt_elite_preview () {
  if (( ! $#* )); then
    prompt_preview_theme elite
    print
    prompt_preview_theme elite green yellow
  else
    prompt_preview_theme elite "$@"
  fi
}

prompt_elite_setup "$@"


(c'set une adaptation du thème elite),
le problème c'est cette partie

Code : Tout sélectionner

%F{$text}%D{%H:%M%P}%F{$punctuation}
qui est censée afficher l'heure mais qui ne fonctionne plus.. vous auriez une idée ? car moi quand je le fais j'obtiens ça : http://hpics.li/672886f

une idée ? merci à vous
Dernière modification par Piczel le mar. 27 oct. 2015, 11:45, modifié 1 fois.
lili : Lenovo E540 | ArchLinux
abraham : RaspBerry Pi 3 B | ArchLinux
isaac : RaspBerry Pi 3 B | ArchLinux
Github
The best way to accelerate a computer running Windows is at 9.81m/s²
10 types de geeks, ceux qui savent compter en binaire, et les autres.
Avatar de l’utilisateur
benjarobin
Maître du Kyudo
Messages : 17686
Inscription : sam. 30 mai 2009, 15:48
Localisation : Lyon

Re: [ZSH] Prompt qui disfonctionne

Message par benjarobin »

Bonjour,
C'est l'option %P qui déconne (voir man strftime et http://zsh.sourceforge.net/Doc/Release/ ... nsion.html), c'est très étrange, mais dans tous les cas tu ne préfères pas un affichage à la française (24h) ?
Pour un affichage au format 24h : Remplace %D{%H:%M%P} par %D{%R}

Edit: Je crois que tu as découvert un bug... je creuse, c'est lié au locale : export LC_ALL=C "corrige" la chose
Zsh | KDE | PC fixe : AMD Ryzen 9900X, Radeon RX 7700 XT
Titre d'un sujet : [Thème] Sujet (état) / Règles du forum
Avatar de l’utilisateur
Piczel
Chu Ko Nu
Messages : 314
Inscription : dim. 03 mai 2015, 19:17
Localisation : Terre du Milieu

Re: [ZSH] Prompt qui disfonctionne

Message par Piczel »

Bonjour,
ma foi c'est possible, je vais essayer avec ton affichage à la française, on va voir, merci
lili : Lenovo E540 | ArchLinux
abraham : RaspBerry Pi 3 B | ArchLinux
isaac : RaspBerry Pi 3 B | ArchLinux
Github
The best way to accelerate a computer running Windows is at 9.81m/s²
10 types de geeks, ceux qui savent compter en binaire, et les autres.
Avatar de l’utilisateur
Piczel
Chu Ko Nu
Messages : 314
Inscription : dim. 03 mai 2015, 19:17
Localisation : Terre du Milieu

Re: [ZSH] Prompt qui disfonctionne

Message par Piczel »

En tout cas avec l'affichage à la française ça marche, merci, je passe en résolu !
lili : Lenovo E540 | ArchLinux
abraham : RaspBerry Pi 3 B | ArchLinux
isaac : RaspBerry Pi 3 B | ArchLinux
Github
The best way to accelerate a computer running Windows is at 9.81m/s²
10 types de geeks, ceux qui savent compter en binaire, et les autres.
Répondre