Ver Fonte

feat(tmux): tmux UI 小修改

dzp há 2 anos atrás
pai
commit
74f0daf232
4 ficheiros alterados com 10 adições e 6 exclusões
  1. 1 1
      etc/ui-settings.tin
  2. 1 1
      mud/pkuxkx/etc/ui-settings.tin
  3. 7 3
      plugins/lib/ui/tmux.tin
  4. 1 1
      tmux.conf

+ 1 - 1
etc/ui-settings.tin

@@ -1,6 +1,6 @@
 #var tmux-update-events[DEFAULT] {char/score};
 #var tmux-pane-border-format[DEFAULT] {
-    {left}      {ID: [<g23><188>\$char[档案][账号]<299>]}
+    {left}      {ID: [<g23><188>\$char[档案][账号]<099>]}
     {centre}    {大名: [\$char[档案][大名]]}
     {right}     {头衔: [\$char[档案][头衔]]}
 };

+ 1 - 1
mud/pkuxkx/etc/ui-settings.tin

@@ -1,6 +1,6 @@
 #var tmux-update-events[DEFAULT] {char/score};
 #var tmux-pane-border-format[DEFAULT] {
-    {left}      {ID: [<g23><188>\$char[档案][账号]<299>]}
+    {left}      {ID: [<g23><188>\$char[档案][账号]<099>]}
     {centre}    {大名: [\$char[档案][彩色大名]]}
     {right}     {头衔: [\$char[档案][彩色头衔]]}
 };

+ 7 - 3
plugins/lib/ui/tmux.tin

@@ -103,10 +103,14 @@ PaoTin++ © 2020~2023 的所有版权均由担子炮(dzp <danzipao@gmail.com>) 
 #func {tmux.ConvertFromANSI} {
     #local text {%1};
 
+    #if { {$text} == {%*{\e\[22(|;[0-9;]+)m}%*} } {
+        #local esc {\e};
+        #line sub {var;escapes} #format esc {%s} {$esc};
+        #replace {text} {{\e\[22(|;([0-9;]+))m}}            {#[none]@if{@str.Len{&2} > 0;{${esc}[&3m}}};
+    };
+
     #replace {text} {{\e\[(3|4)8;5;(\d+)m}}                 {@tmux.ansi2tmux{&2;5;&3}};
-    #replace {text} {{\e\[22;(3|4)8;5;(\d+)m}}              {#[none]@tmux.ansi2tmux{&2;5;&3}};
     #replace {text} {{\e\[(3|4)8;2;(\d+);(\d+);(\d+)m}}     {@tmux.ansi2tmux{&2;2;&3;&4;&5}};
-    #replace {text} {{\e\[22;(3|4)8;2;(\d+);(\d+);(\d+)m}}  {#[none]@tmux.ansi2tmux{&2;2;&3;&4;&5}};
 
     #local {mode} {TEXT};
     #local output {};
@@ -207,7 +211,7 @@ PaoTin++ © 2020~2023 的所有版权均由担子炮(dzp <danzipao@gmail.com>) 
 #func {tmux.Width} {
     #local arg {%1};
     #replace {arg} {{#\[[^\]]*\]}} {};
-    #return {@len{$arg}};
+    #return {@str.Len{$arg}};
 };
 
 #nop 默认每分钟更新一次。;

+ 1 - 1
tmux.conf

@@ -44,7 +44,7 @@ set -g status-interval 10
 # 状态栏的窗口列表靠左显示
 set -g status-justify left
 # 状态栏的整体色调背景色为蓝色
-set -g status-style bg=#0000FF
+set -g status-style bg=#0000AA
 # 状态栏左部最大长度不超过 32
 set -g status-left-length 32
 # 状态栏左部的格式: 亮品红的日期时间,然后是亮黄色的主机名(#h)