3C科技 娛樂遊戲 美食旅遊 時尚美妝 親子育兒 生活休閒 金融理財 健康運動 寰宇綜合

Zi 字媒體

2017-07-25T20:27:27+00:00
加入好友
用editor打開 ~/.bashrc 這支檔案,並看到這一段(約在56~60行) if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' fi 12345 if [ "$color_prompt" = yes ]; thenPS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w[\033[00m\]\$ 'elsePS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ 'fi 這段是判斷有無開啟彩色Terminal顯示模式 第二行為預設的顯示設定,顯示的樣子大概像這樣 要顯示window number則改成下列內容 if [ "$color_prompt" = yes ]; then if [ "$WINDOW" = "" ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;35m\][W$WINDOW]\[\033[00m\]\$ ' fi else 1234567 if [ "$color_prompt" = yes ]; thenif [ "$WINDOW" = "" ]; thenPS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ 'elsePS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;35m\][W$WINDOW]\[\033[00m\]\$ 'fielse 在彩色Terminal顯示模式裡面再加一個判斷screen是否啟用,沒有的話顯示預設樣式,有的話則顯示成有加入window number的樣式 簡單說明一下PS1修改的內容區分為兩部分 \[\033[01;35m\] 這段是宣告文字顏色(這裡用亮紫色當示範) [W$WINDOW] 圖片中顯示[W6],$WINDOW這個變數是   修改儲存後下screen開新視窗後顯示的樣子就像這樣   完成收工! [Ubuntu] 於指令列顯示screen的window number was last modified: 2017-02-06 by Calos分享這篇文章按一下以分享至 Facebook(在新視窗中開啟)按一下以分享到 Google+(在新視窗中開啟)分享到 Twitter(在新視窗中開啟)分享到 LinkedIn(在新視窗中開啟)分享到 Reddit(在新視窗中開啟)分享到 Pocket(在新視窗中開啟)

本文由caloskaoorg提供 原文連結

寫了 5860316篇文章,獲得 23313次喜歡
精彩推薦