Nge-Terminal: Ukwenza ngcono ukubonakala kwekhonsoli

Ngingomunye walabo abathanda ukusebenzisa i-terminal. Ngicabanga ukuthi bonke abasebenzisi be I-GNU / Linux Ngesinye isikhathi abakwazi ukuhlala ngaphandle kwayo, ngoba lelocezu lewindi eligcwele izinhlamvu lenza impilo ibe lula kakhulu, akunjalo?

Kepha singakwenza ukuthi kubukeke kukuhle kancane kunokuzenzakalelayo. Isibonelo salokhu singabonakala (futhi silandwe) kusuka ku- ukubukeka okuhle. Amathiphu engizokukhombisa wona ngezansi ukushiya i-terminal yethu ngokubukeka okulandelayo:

Njengoba ukwazi ukubona, i- umyalo wokukhipha futhi ibekwa phakathi kwe-oda ngalinye umugqa wesikhathi nesikhathi sohlelo.

Ngikwenza kanjani?

Sivula isihleli sombhalo (isibonelo I-Gedit) bese sikufaka ngaphakathi:

# Fill with minuses
# (this is recalculated every time the prompt is shown in function prompt_command):

fill="--- "
reset_style='\[\033[00m\]'
status_style=$reset_style'\[\033[0;90m\]' # gray color; use 0;37m for lighter color
prompt_style=$reset_style
command_style=$reset_style'\[\033[1;29m\]' # bold black
# Prompt variable:
PS1="$status_style"'$fill \t\n'"$prompt_style"'${debian_chroot:+($debian_chroot)}\u@\h:\w\$'"$command_style "
# Reset color for command output
# (this one is invoked every time before a command is executed):
trap 'echo -ne "\e[0m"' DEBUG
function prompt_command {
# create a $fill of all screen width minus the time string and a space:
let fillsize=${COLUMNS}-9
fill=""
while [ "$fillsize" -gt "0" ] do
fill="-${fill}" # fill with underscores to work on
let fillsize=${fillsize}-1
done
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
bname=`basename "${PWD/$HOME/~}"`
echo -ne "\033]0;${bname}: ${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"
;;
*)
;;
esac
}
PROMPT_COMMAND=prompt_command

Sikugcina ngaphakathi kwe- / ekhaya enegama .bhash_ps2 Ngokwesibonelo. Ngemuva kwalokho sivula eyethu .bashrc futhi sengeza:

if [ -f "$HOME/.bash_ps2" ]; then
. "$HOME/.bash_ps2"
fi

Sivula ukuphela futhi siyabona izinguquko 😀

 

Kubonwe ku-: Abantu.


Okuqukethwe yi-athikili kunamathela ezimisweni zethu ze izimiso zokuhlelela. Ukubika iphutha chofoza lapha.

Amazwana ayi-17, shiya okwakho

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe. Ezidingekayo ibhalwe nge *

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.

  1.   Luweeds kusho

    Ngiyabonga ngebhulogi kuqala futhi nombuzo, ngabe kukhona okungenzeka kube ngokwezifiso i-xterm noma i-lxterminal ngale kombala wombhalo nangemuva? (Yizindawo zokugcina engizisebenzisa kakhulu).
    Siyabonga!

  2.   Eduardo kusho

    I-GENIALLLLLLLLLLLLLLL 🙂

    Ngizamile esontweni eledlule lapho ngifunda lesi sihloko kwenye ibhulogi, kepha ngenxa yenkinga ngezingcaphuno kulokho obekufanele kungezwe ku- .bashrc Angikwazanga ukuyisebenzisa. Manje kungisebenzele kahle kuqala.

    Ngiyabonga

    1.    KZKG ^ Gaara kusho

      Kuyinjabulo ukwazi ukuthi ikwenzile nje lokho obukufuna 😉
      Phendula ngokucaphuna

  3.   I-Taregon kusho

    :] muhle uma yenza engicabanga ukuthi ngicabanga ... weeee, ngiyifaka kule mpelasonto 😀

    1.    KZKG ^ Gaara kusho

      Empeleni ngiyithuthukisile hehe ... ngifaka amahloni amaningi futhi kubukeka kungcono kakhulu, ngizokwenza okuthunyelwe ngishicilele ukuthuthuka kwami ​​nokulungiswa kwami ​​😉

      Ihlelwe: Esikhundleni sokufaka lokho .bhash_ps2 beka lokhu okunye: http://paste.desdelinux.net/paste/6

      1.    Eduardo kusho

        Ngithola iphutha emigqeni 13 no-34.

        1.    I-elav <° Linux kusho

          Sesivele siyi-2 😀

      2.    Isibindi kusho

        Fuck, omunye umklami ohlangothini olumnyama ...

        1.    KZKG ^ Gaara kusho

          Ngishiya ikhodi lapha, angazi ukuthi kungani ibanikeza iphutha ... o_0U ungisebenzela kahle:
          # Fill with minuses
          # (this is recalculated every time the prompt is shown in function prompt_command):

          fill="--- "
          reset_style='\[\033[00m\]'
          status_style=$reset_style'\[\033[0;90m\]' # gray color; use 0;37m for lighter color
          prompt_style=$reset_style
          command_style=$reset_style'\[\033[1;29m\]' # bold black
          # Prompt variable:
          PS1="$status_style"'$fill \t\n'"$prompt_style"'${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m$
          # Reset color for command output
          # (this one is invoked every time before a command is executed):
          trap 'echo -ne "\e[0m"' DEBUG
          function prompt_command {
          # create a $fill of all screen width minus the time string and a space:
          let fillsize=${COLUMNS}-9
          fill=""
          while [ "$fillsize" -gt "0" ]
          do
          fill="-${fill}" # fill with underscores to work on
          let fillsize=${fillsize}-1
          done
          # If this is an xterm set the title to user@host:dir
          case "$TERM" in
          xterm*|rxvt*)
          bname=`basename "${PWD/$HOME/~}"`
          echo -ne "\033]0;${bname}: ${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"
          ;;
          *)
          ;;
          esac
          }
          PROMPT_COMMAND=prompt_command

  4.   I-newbie kusho

    Kuhle kakhulu lokhu, ngisanda kukuhlola futhi kusebenza i-100% ubuntu 11.10

    Ukubingelela !!

  5.   rob kusho

    Yebo, ngithola nephutha kulayini 13 no 34

    ulayini 13: I-EOF engalindelekile ngenkathi kuseshwa ukufana ``
    ulayini 34: iphutha le-syntactic: ukuphela kwefayela bekungalindelekile

    Ngisebenzisa i-linux mint 11 lxde ukuthola ukubaluleka kwayo.

    Ukubingelela!

  6.   U-Jimselfking kusho

    Isebenza ngo-100% nomsebenzisi ojwayelekile, kepha lapho uba umphathi omkhulu iyeka ukusebenza, ayenzi lutho. Ngicabanga ukuthi kulula, kepha angazi ukuthi ngenza kanjani okuningi, noma yisiphi isixazululo?

    1.    KZKG ^ Gaara kusho

      Okufaka ku .bashrc, kufanele futhi uyifake /root/.bashrc
      Thatha isivivinyo bese usitshela ukuthi unjani 🙂

      Sanibonani

      1.    U-Jimselfking kusho

        Isebenza kahle, angazi ukuthi angizange ngiyizame kanjani ngaphambi kokubuza. Ngiyabonga

        1.    I-KZKG ^ Gaara <° Linux kusho

          Nah ungakhathazeki 🙂

  7.   angel kusho

    Sawubona mngani, uma uzongisiza ngicela ngizamile kodwa umbuthano awubonakali futhi usagqamile, ngisebenzisa i-fedora19, umugqa wesikhathi uma uvela ... ngisabonga kakhulu ngeqhaza lakho 🙂

  8.   Miguel kusho

    ngabe lokhu kusebenza ngokufanayo ku-Debian ???