@kecan0406/ttheme 1.2.16 → 1.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -14
- package/bin/ttheme.js +207 -205
- package/bin/ttheme.js.map +1 -1
- package/dist/manifest.json +1 -1
- package/package.json +3 -2
- package/shell/adapters/_osc.zsh +2 -0
- package/shell/adapters/terminal-app.zsh +5 -0
- package/shell/preview.zsh +140 -63
- package/shell/ttheme.zsh +12 -6
package/dist/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kecan0406/ttheme",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ttheme": "bin/ttheme.js"
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
"fast-string-width": "^3.0.2",
|
|
42
42
|
"pngjs": "7.0.0",
|
|
43
43
|
"smol-toml": "^1.9.0",
|
|
44
|
-
"typescript": "^5.8.2"
|
|
44
|
+
"typescript": "^5.8.2",
|
|
45
|
+
"uqr": "^0.1.3"
|
|
45
46
|
},
|
|
46
47
|
"engines": {
|
|
47
48
|
"bun": ">=1.3",
|
package/shell/adapters/_osc.zsh
CHANGED
|
@@ -167,6 +167,11 @@ __tt_pv_leave() {
|
|
|
167
167
|
painted=$orig
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
__tt_pv_forget() {
|
|
171
|
+
TTHEME_TERMINAL_SHOWN=""
|
|
172
|
+
__tt_out $'\e]104\e\\\e]110\e\\\e]111\e\\\e]112\e\\\e]117\e\\'
|
|
173
|
+
}
|
|
174
|
+
|
|
170
175
|
__tt_bg_shown() {
|
|
171
176
|
REPLY=${TTHEME_TERMINAL_SHOWN%% *}
|
|
172
177
|
[[ -n $REPLY ]]
|
package/shell/preview.zsh
CHANGED
|
@@ -203,6 +203,7 @@ __tt_pv_lw() {
|
|
|
203
203
|
(( l < 30 )) && l=30
|
|
204
204
|
fi
|
|
205
205
|
(( sw > pw - l - 6 )) && sw=$(( pw - l - 6 ))
|
|
206
|
+
(( te && sw < 50 )) && sw=0
|
|
206
207
|
if (( color && sw >= 32 )); then
|
|
207
208
|
lw=$l
|
|
208
209
|
else
|
|
@@ -305,13 +306,13 @@ __tt_pv_row() {
|
|
|
305
306
|
fi
|
|
306
307
|
}
|
|
307
308
|
|
|
308
|
-
|
|
309
|
+
__tt_pv_bg_credit() {
|
|
309
310
|
local by=${bgby[$tpick]} ref=${bgfrom[$tpick]} url=${bgurl[$tpick]} mark="" sgr=""
|
|
310
311
|
local -i room=$1
|
|
311
312
|
[[ -n $ref && $url == http(s|)://* ]] && __tt_links && mark="⧉ "
|
|
312
|
-
REPLY
|
|
313
|
-
(( ${#REPLY} > room )) && REPLY
|
|
314
|
-
(( ${#REPLY} > room )) && REPLY=
|
|
313
|
+
REPLY=${by:+by $by}${by:+${ref:+ · }}${ref:+$mark$ref}
|
|
314
|
+
(( ${#REPLY} > room )) && REPLY=${by:+by $by}
|
|
315
|
+
(( ${#REPLY} > room )) && REPLY=""
|
|
315
316
|
[[ -n $mark && $REPLY == *"$mark$ref"* ]] || return 0
|
|
316
317
|
(( color )) && [[ -n ${TTHEME_SITE_ANSI[${ref%% *}]} ]] && sgr=$'\e[3'${TTHEME_SITE_ANSI[${ref%% *}]}m
|
|
317
318
|
REPLY=${REPLY/"$mark$ref"/$sgr⧉${sgr:+$'\e[39m'} $'\e]8;;'$url$'\e\\'$ref$'\e]8;;\e\\'}
|
|
@@ -363,7 +364,9 @@ __tt_pv_foot() {
|
|
|
363
364
|
hex=${${=applied}[8]#\#}
|
|
364
365
|
printf -v y '\e[38;2;%d;%d;%dm' $((16#${hex:0:2})) $((16#${hex:2:2})) $((16#${hex:4:2}))
|
|
365
366
|
fi
|
|
366
|
-
if (( help )); then
|
|
367
|
+
if (( help == 2 )); then
|
|
368
|
+
badge=HELP right=$b"any key"$z$d" close"$z
|
|
369
|
+
elif (( help )); then
|
|
367
370
|
badge=HELP right=$b"? esc"$z$d" close"$z
|
|
368
371
|
elif [[ -n $pick ]]; then
|
|
369
372
|
badge='PREVIEW (APPLY)' lead="$pick →"
|
|
@@ -551,7 +554,11 @@ __tt_pv_help() {
|
|
|
551
554
|
(( hub )) && { hk+=(Screens); hv+=("shift+tab · tab on a series") }
|
|
552
555
|
fi
|
|
553
556
|
hk+=(Close)
|
|
554
|
-
|
|
557
|
+
if (( help == 2 )); then
|
|
558
|
+
hv+=("any key · ? brings this back")
|
|
559
|
+
else
|
|
560
|
+
hv+=("? esc")
|
|
561
|
+
fi
|
|
555
562
|
(( color )) || z= b=
|
|
556
563
|
local -i i r x y w hh
|
|
557
564
|
if (( split && sw >= 48 )); then
|
|
@@ -1005,7 +1012,7 @@ __tt_pv_draw() {
|
|
|
1005
1012
|
fi
|
|
1006
1013
|
[[ $1 == hint ]] && (( ! wiped )) || pvz=()
|
|
1007
1014
|
if (( pw < 40 || ph < 12 )); then
|
|
1008
|
-
line="ttheme
|
|
1015
|
+
line="ttheme"
|
|
1009
1016
|
(( color )) && line=$'\e[1m'$ac$line$'\e[0m'
|
|
1010
1017
|
out+=$line$'\e[K\n'"Needs 40×12 — now ${pw}×${ph}"$'\e[K\n'
|
|
1011
1018
|
line="esc quits"
|
|
@@ -1449,6 +1456,7 @@ __tt_pv_bg_track() {
|
|
|
1449
1456
|
|
|
1450
1457
|
__tt_pv_wheel() {
|
|
1451
1458
|
local -i i
|
|
1459
|
+
(( help == 2 )) && help=0
|
|
1452
1460
|
if (( help )); then
|
|
1453
1461
|
return 0
|
|
1454
1462
|
elif (( conf )); then
|
|
@@ -1493,7 +1501,8 @@ __tt_pv_screen() {
|
|
|
1493
1501
|
err=$(TTHEME_HUB=${TTHEME_HUB_TABS[to]} __tt_cli ${TTHEME_HUB_TABS[to]} 2>&1 >/dev/tty)
|
|
1494
1502
|
rc=$?
|
|
1495
1503
|
if (( rc == TTHEME_HUB_CLOSED )); then
|
|
1496
|
-
hubleft=1
|
|
1504
|
+
hubleft=1 painted=?
|
|
1505
|
+
__tt_pv_forget
|
|
1497
1506
|
return 1
|
|
1498
1507
|
elif (( rc > TTHEME_HUB_SWITCH && rc <= TTHEME_HUB_SWITCH + n )); then
|
|
1499
1508
|
to=$(( rc - TTHEME_HUB_SWITCH ))
|
|
@@ -1535,20 +1544,26 @@ __tt_te_save_image() {
|
|
|
1535
1544
|
|
|
1536
1545
|
__tt_te_read() {
|
|
1537
1546
|
local rows
|
|
1538
|
-
|
|
1547
|
+
local -i wide=${1:-0}
|
|
1548
|
+
if (( ! wide )); then
|
|
1549
|
+
__tt_pv_lw
|
|
1550
|
+
wide=${reply[2]}
|
|
1551
|
+
(( wide )) || wide=$(( pw - 2 < 66 ? pw - 3 : 65 ))
|
|
1552
|
+
fi
|
|
1553
|
+
tewide=$wide
|
|
1554
|
+
rows=$(__tt_cli tone $tename show $wide 2>/dev/null) || return 1
|
|
1539
1555
|
teframe=("${(@f)rows}")
|
|
1540
1556
|
return 0
|
|
1541
1557
|
}
|
|
1542
1558
|
|
|
1543
1559
|
__tt_te_open() {
|
|
1544
1560
|
local name=$1
|
|
1545
|
-
tename=$name tfocus=0 teframe=() tetop=0 msgt=0
|
|
1561
|
+
tename=$name tfocus=0 teframe=() tetop=0 msgt=0 te=1
|
|
1546
1562
|
if ! __tt_te_read; then
|
|
1547
1563
|
msg="Could not read the colors of $name" msgt=300
|
|
1548
|
-
tename=""
|
|
1564
|
+
tename="" te=0
|
|
1549
1565
|
return 0
|
|
1550
1566
|
fi
|
|
1551
|
-
te=1
|
|
1552
1567
|
(( bgcw )) && __tt_pv_bg_state $name && __tt_pv_tune_open $name
|
|
1553
1568
|
__tt_te_image && __tt_te_to_image 1
|
|
1554
1569
|
resized=1
|
|
@@ -1803,79 +1818,137 @@ __tt_pv_te_ghost() {
|
|
|
1803
1818
|
return 0
|
|
1804
1819
|
}
|
|
1805
1820
|
|
|
1806
|
-
|
|
1807
|
-
local
|
|
1821
|
+
__tt_pv_te_edge() {
|
|
1822
|
+
local left=$4 right=$5 sty=$6 hs=$7 head=$8 tail=$9 z=$'\e[0m' line
|
|
1823
|
+
local -i y=$1 col=$2 w=$3 n
|
|
1824
|
+
(( color )) || z=
|
|
1825
|
+
n=$(( w - 3 - (${#head} ? ${#head} + 2 : 0) - (${#tail} ? ${#tail} + 3 : 0) ))
|
|
1826
|
+
(( n < 0 )) && n=0
|
|
1827
|
+
line=$sty$left"─"$z
|
|
1828
|
+
[[ -n $head ]] && line+=$hs" $head "$z
|
|
1829
|
+
line+=$sty${(l:n::─:)}
|
|
1830
|
+
[[ -n $tail ]] && line+=" $tail ─"
|
|
1831
|
+
out+=$'\e['$y';'$col'H'$line$right$z
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
__tt_pv_te_sides() {
|
|
1835
|
+
local sty=$5 z=$'\e[0m'
|
|
1836
|
+
local -i y r1=$2 col=$3 w=$4
|
|
1837
|
+
(( color )) || z=
|
|
1838
|
+
for (( y = $1; y <= r1; y++ )); do
|
|
1839
|
+
out+=$'\e['$y';'$col'H'$sty"│"$z$'\e['$y';'$(( col + w - 1 ))'H'$sty"│"$z
|
|
1840
|
+
done
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
__tt_pv_te_images() {
|
|
1844
|
+
local z=$'\e[0m' d=$'\e[2m' b=$'\e[1m' st=" " tt note="0/0"
|
|
1808
1845
|
local -a held
|
|
1809
|
-
local -i
|
|
1846
|
+
local -i y=$1 col=$2 end=$3 n
|
|
1847
|
+
(( color )) || z= d= b=
|
|
1848
|
+
tt=$d
|
|
1849
|
+
if [[ -n $tune ]]; then
|
|
1850
|
+
held=(${=bgpics[$tune]})
|
|
1851
|
+
n=${held[(Ie)${${tpick#$tune}#:}]}
|
|
1852
|
+
(( n )) || n=${held[(Ie)${bgact[$tune]}]}
|
|
1853
|
+
(( n )) || n=1
|
|
1854
|
+
note="$n/$(( ${#held} ? ${#held} : 1 ))"
|
|
1855
|
+
fi
|
|
1856
|
+
(( tfocus == 1 && tf == 5 )) && st=$ac"▶"$z" " tt=$b
|
|
1857
|
+
out+=$'\e['$y';'$col'H'$st$tt"Images"$z$'\e['$y';'$(( end - ${#note} + 1 ))'H'$d$note$z
|
|
1858
|
+
pvz+=("$y $col $end teimg")
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
__tt_pv_te_editrow() {
|
|
1862
|
+
local z=$'\e[0m' d=$'\e[2m' b=$'\e[1m' note="tunes its colors full screen"
|
|
1863
|
+
local -i y=$1 col=$2 end=$3
|
|
1864
|
+
(( color )) || z= d= b=
|
|
1865
|
+
pvz+=("$y $col $end teedit")
|
|
1866
|
+
out+=$'\e['$y';'$(( col + 2 ))'H'
|
|
1867
|
+
if (( tfocus == 0 )); then
|
|
1868
|
+
(( color )) && out+=$ac"▶"$z" "$'\e[7;1m'$ac" Edit palette "$z || out+="▶ [Edit palette]"
|
|
1869
|
+
else
|
|
1870
|
+
(( color )) && out+=" "$b" Edit palette "$z || out+=" Edit palette "
|
|
1871
|
+
fi
|
|
1872
|
+
(( ${#note} > end - col - 21 )) && note=${note[1,end-col-21]}
|
|
1873
|
+
out+=" "$d$note$z
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
__tt_pv_te_panel() {
|
|
1877
|
+
local z=$'\e[0m' d=$'\e[2m' b=$'\e[1m' fs hs st note row REPLY
|
|
1878
|
+
local -i col=$1 end=$2 r0=$3 r1=$4 ix=$(( $1 + 2 )) ie=$(( $2 - 2 )) R W T P I=3 V i y pics=0 tfs=$tf
|
|
1810
1879
|
(( color )) || z= d= b=
|
|
1811
1880
|
R=$(( r1 - r0 + 1 )) W=$(( end - col + 1 ))
|
|
1812
|
-
|
|
1813
|
-
|
|
1881
|
+
(( tewide == W )) || __tt_te_read $W
|
|
1882
|
+
T=${#teframe} P=$(( ${#teframe} + 2 ))
|
|
1883
|
+
__tt_te_image && pics=1
|
|
1884
|
+
(( pics && 18 <= R && (tfocus == 1 || 18 + P + 1 <= R) )) && I=18
|
|
1885
|
+
V=$(( I + P + 1 ))
|
|
1814
1886
|
if (( V <= R || tfocus == 1 )); then
|
|
1815
1887
|
tetop=0
|
|
1816
1888
|
else
|
|
1817
1889
|
tetop=$(( V - R ))
|
|
1818
1890
|
fi
|
|
1891
|
+
fs=$d hs=$d
|
|
1892
|
+
(( tfocus == 1 )) && fs=$ac hs=$b$ac
|
|
1819
1893
|
if (( tetop == 0 && I <= R )); then
|
|
1820
1894
|
y=$r0
|
|
1821
|
-
|
|
1822
|
-
((
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1895
|
+
st=""
|
|
1896
|
+
[[ -n $tune ]] && { (( bgoff[$tpick] )) && st=off || st=on }
|
|
1897
|
+
__tt_pv_te_edge $y $col $W ╭ ╮ "$fs" "$hs" Image "$st"
|
|
1898
|
+
__tt_pv_te_sides $(( y + 1 )) $(( y + I - 2 )) $col $W "$fs"
|
|
1899
|
+
__tt_pv_te_edge $(( y + I - 1 )) $col $W ╰ ╯ "$fs"
|
|
1900
|
+
if (( pics )); then
|
|
1901
|
+
for (( i = 0; i < I; i++ )); do
|
|
1902
|
+
pvz+=("$(( y + i )) $col $end teimg")
|
|
1903
|
+
done
|
|
1829
1904
|
fi
|
|
1830
|
-
if (( I ==
|
|
1831
|
-
held=() n=0 note="0/0"
|
|
1905
|
+
if (( I == 18 )); then
|
|
1832
1906
|
if [[ -n $tune ]]; then
|
|
1833
|
-
|
|
1834
|
-
n
|
|
1835
|
-
(( n )) || n=${held[(Ie)${bgact[$tune]}]}
|
|
1836
|
-
(( n )) || n=1
|
|
1837
|
-
note="$n/$(( ${#held} ? ${#held} : 1 ))"
|
|
1907
|
+
__tt_pv_bg_credit $(( ie - ix + 1 ))
|
|
1908
|
+
[[ -n $REPLY ]] && out+=$'\e['$(( y + 1 ))';'$ix'H'$d$REPLY$z
|
|
1838
1909
|
fi
|
|
1839
|
-
|
|
1840
|
-
(( tfocus == 1 && tf == 5 )) && st=$ac"▶"$z" " tt=$b
|
|
1841
|
-
out+=$'\e['$(( y + 2 ))';'$col'H'$st$tt"Images"$z$'\e['$(( y + 2 ))';'$(( end - ${#note} + 1 ))'H'$d$note$z
|
|
1842
|
-
pvz+=("$(( y + 2 )) $col $end teimg")
|
|
1910
|
+
__tt_pv_te_images $(( y + 2 )) $ix $ie
|
|
1843
1911
|
if [[ -n $tune ]]; then
|
|
1844
|
-
bgstrip="$(( y + 2 )) $
|
|
1912
|
+
bgstrip="$(( y + 2 )) $ix $ie"
|
|
1845
1913
|
(( tfocus == 1 )) || tf=0
|
|
1846
|
-
__tt_pv_bg_panel $tpick $(( y + 9 )) $
|
|
1914
|
+
__tt_pv_bg_panel $tpick $(( y + 9 )) $ix $ie
|
|
1847
1915
|
tf=$tfs
|
|
1848
1916
|
else
|
|
1849
|
-
__tt_pv_te_tile $(( y + 3 )) $
|
|
1917
|
+
__tt_pv_te_tile $(( y + 3 )) $ix
|
|
1850
1918
|
for (( i = 3; i <= 7; i++ )); do
|
|
1851
|
-
pvz+=("$(( y + i )) $
|
|
1919
|
+
pvz+=("$(( y + i )) $ix $(( ix + 30 )) tefind")
|
|
1852
1920
|
done
|
|
1853
|
-
__tt_pv_te_ghost $(( y + 9 )) $
|
|
1921
|
+
__tt_pv_te_ghost $(( y + 9 )) $ix $ie
|
|
1854
1922
|
fi
|
|
1923
|
+
elif (( pics )); then
|
|
1924
|
+
__tt_pv_te_images $(( y + 1 )) $ix $ie
|
|
1855
1925
|
elif (( bgcw )); then
|
|
1856
|
-
out+=$'\e['$(( y +
|
|
1926
|
+
out+=$'\e['$(( y + 1 ))';'$ix'H'$d"No picture yet"$z
|
|
1857
1927
|
else
|
|
1858
|
-
out+=$'\e['$(( y +
|
|
1928
|
+
out+=$'\e['$(( y + 1 ))';'$ix'H'$d"This terminal shows no pictures"$z
|
|
1859
1929
|
fi
|
|
1860
1930
|
fi
|
|
1861
|
-
|
|
1862
|
-
|
|
1931
|
+
fs=$d
|
|
1932
|
+
(( tfocus == 0 )) && fs=$ac
|
|
1933
|
+
for (( i = 1; i <= P; i++ )); do
|
|
1934
|
+
y=$(( r0 + I + i - 1 - tetop ))
|
|
1863
1935
|
(( y >= r0 && y <= r1 )) || continue
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
pvz+=("$y $col $end teedit")
|
|
1870
|
-
out+=$'\e['$y';'$col'H'
|
|
1871
|
-
if (( tfocus == 0 )); then
|
|
1872
|
-
(( color )) && out+=$ac"▶"$z" "$'\e[7;1m'$ac" Edit palette "$z || out+="▶ [Edit palette]"
|
|
1936
|
+
if (( i == T )); then
|
|
1937
|
+
__tt_pv_te_edge $y $col $W ├ ┤ "$fs"
|
|
1938
|
+
elif (( i == T + 1 )); then
|
|
1939
|
+
__tt_pv_te_sides $y $y $col $W "$fs"
|
|
1940
|
+
__tt_pv_te_editrow $y $col $end
|
|
1873
1941
|
else
|
|
1874
|
-
|
|
1942
|
+
row=${teframe[i == P ? T : i]}
|
|
1943
|
+
if (( tfocus == 0 && color )); then
|
|
1944
|
+
row=${${row//$'\e[2m'/$ac}//$'\e[22m'/$'\e[22;39m'}
|
|
1945
|
+
(( i == 1 )) && row=${row/ Palette /$'\e[1m Palette \e[22m'}
|
|
1946
|
+
fi
|
|
1947
|
+
out+=$'\e['$y';'$col'H'$row$z
|
|
1948
|
+
pvz+=("$y $col $end tepal")
|
|
1875
1949
|
fi
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
y=$(( r0 + V - 1 - tetop ))
|
|
1950
|
+
done
|
|
1951
|
+
y=$(( r0 + I + P - tetop ))
|
|
1879
1952
|
(( y >= r0 && y <= r1 )) || return 0
|
|
1880
1953
|
pvz+=("$y $col $end teapply")
|
|
1881
1954
|
if [[ $mode == pin ]]; then
|
|
@@ -1885,7 +1958,7 @@ __tt_pv_te_panel() {
|
|
|
1885
1958
|
else
|
|
1886
1959
|
note="saves and wears it in this tab"
|
|
1887
1960
|
fi
|
|
1888
|
-
out+=$'\e['$y';'$
|
|
1961
|
+
out+=$'\e['$y';'$ix'H'
|
|
1889
1962
|
if (( tfocus == 2 )); then
|
|
1890
1963
|
(( color )) && out+=$ac"▶"$z" "$'\e[7;1m'$ac" Apply "$z || out+="▶ [Apply]"
|
|
1891
1964
|
else
|
|
@@ -1928,9 +2001,11 @@ __tt_pv_handle() {
|
|
|
1928
2001
|
if (( help )); then
|
|
1929
2002
|
case $key in
|
|
1930
2003
|
$'\x03') return 1 ;;
|
|
1931
|
-
'?'|esc) help=0 ;;
|
|
2004
|
+
'?'|esc) help=0; return 0 ;;
|
|
2005
|
+
nop) return 0 ;;
|
|
1932
2006
|
esac
|
|
1933
|
-
return 0
|
|
2007
|
+
(( help == 2 )) || return 0
|
|
2008
|
+
help=0
|
|
1934
2009
|
fi
|
|
1935
2010
|
if [[ -n $pick ]]; then
|
|
1936
2011
|
__tt_pv_pick
|
|
@@ -2070,7 +2145,7 @@ __tt_preview() {
|
|
|
2070
2145
|
local -i hub=0 hubleft=0
|
|
2071
2146
|
[[ $mode == hub ]] && hub=1
|
|
2072
2147
|
if [[ ! -t 0 || ! -t 1 ]]; then
|
|
2073
|
-
print -u2 "ttheme $
|
|
2148
|
+
print -u2 "ttheme $mode: needs a terminal"
|
|
2074
2149
|
return 1
|
|
2075
2150
|
fi
|
|
2076
2151
|
local orig=$TTHEME_SPEC applied=$TTHEME_SPEC painted=$TTHEME_SPEC flt="" sel="" cn="" cdot="" key="" REPLY="" cur=1 top=1 color=0 pw=80 ph=24 resized=1 expal="" exgrp="" exnext=0 gstep=0 gseed=0 tick=0
|
|
@@ -2082,7 +2157,7 @@ __tt_preview() {
|
|
|
2082
2157
|
local -A bgpic=() bgpics=() bgact=() bgview=() bgswap=() bgthumb=() tsnaps=() pvseek=() bgcolors=() bgprep=() TTHEME_ALIASES=()
|
|
2083
2158
|
local conf=0 cf=1
|
|
2084
2159
|
local -a plabel=(" Default " " This tab ") pkeys=() reach=() csnap=() teframe=()
|
|
2085
|
-
local te=0 tfocus=0 tetop=0 tename=""
|
|
2160
|
+
local te=0 tfocus=0 tetop=0 tewide=0 tename=""
|
|
2086
2161
|
local -i pvgone=0 bgprepid=0 mrow=0 mcol=0 mclick=0 mwheel=0 mlwheel=0 mlrow=0 mlcol=0
|
|
2087
2162
|
local -F mlast=0
|
|
2088
2163
|
local mact="" mzone="" pvmouse=""
|
|
@@ -2112,6 +2187,8 @@ __tt_preview() {
|
|
|
2112
2187
|
__tt_pv_roll
|
|
2113
2188
|
__tt_pv_rows
|
|
2114
2189
|
[[ -n ${TTHEME_PALETTE[$cn]} ]] && __tt_pv_goto "$cn"
|
|
2190
|
+
__tt_pv_lw
|
|
2191
|
+
(( reply[2] >= 48 )) && help=2
|
|
2115
2192
|
local tty=""
|
|
2116
2193
|
local -i TTHEME_RAW=0
|
|
2117
2194
|
{
|
package/shell/ttheme.zsh
CHANGED
|
@@ -274,7 +274,7 @@ source $TTHEME_HOME/adapters/_wired.zsh
|
|
|
274
274
|
source $TTHEME_HOME/adapters/$TTHEME_ADAPTER.zsh
|
|
275
275
|
|
|
276
276
|
__tt_empty() {
|
|
277
|
-
print -u2 'ttheme: no palettes installed yet — run `ttheme
|
|
277
|
+
print -u2 'ttheme: no palettes installed yet — run `ttheme` in a terminal to pick some, or `ttheme add <palette>`'
|
|
278
278
|
return 1
|
|
279
279
|
}
|
|
280
280
|
|
|
@@ -1310,7 +1310,10 @@ __tt_catalog() {
|
|
|
1310
1310
|
|
|
1311
1311
|
__tt_catalog_done() {
|
|
1312
1312
|
[[ -r $TTHEME_HOME/palettes.zsh ]] || return 0
|
|
1313
|
-
|
|
1313
|
+
local was=$TTHEME_PALETTES_AT
|
|
1314
|
+
if __tt_palettes_load && [[ $TTHEME_PALETTES_AT != "$was" ]]; then
|
|
1315
|
+
__tt_reloaded
|
|
1316
|
+
fi
|
|
1314
1317
|
[[ "$TTHEME_STARTUP ${TTHEME_PALETTE[$TTHEME_STARTUP]}" == "$1" ]] && return 0
|
|
1315
1318
|
__tt_follow "$1"
|
|
1316
1319
|
__tt_worn_shown
|
|
@@ -1471,17 +1474,21 @@ ttheme() {
|
|
|
1471
1474
|
__tt_unpainted && __tt_paints || return 1
|
|
1472
1475
|
fi
|
|
1473
1476
|
if (( ! $# )); then
|
|
1474
|
-
(( ${#TTHEME_PALETTE} )) || { __tt_empty; return }
|
|
1475
1477
|
if [[ -t 0 && -t 1 ]]; then
|
|
1476
|
-
|
|
1478
|
+
if (( ${#TTHEME_PALETTE} )); then
|
|
1479
|
+
__tt_preview hub
|
|
1480
|
+
else
|
|
1481
|
+
__tt_catalog browse
|
|
1482
|
+
fi
|
|
1477
1483
|
else
|
|
1484
|
+
(( ${#TTHEME_PALETTE} )) || { __tt_empty; return }
|
|
1478
1485
|
__tt_menu
|
|
1479
1486
|
fi
|
|
1480
1487
|
return 0
|
|
1481
1488
|
fi
|
|
1482
1489
|
|
|
1483
1490
|
case $1 in
|
|
1484
|
-
|
|
1491
|
+
list|add|remove|update|market|new|edit|check|share) __tt_catalog "$@"; return ;;
|
|
1485
1492
|
on|off) __tt_switch "$@"; return ;;
|
|
1486
1493
|
info) TTHEME_ZSH=$ZSH_VERSION __tt_cli "$@"; return ;;
|
|
1487
1494
|
esac
|
|
@@ -1498,7 +1505,6 @@ ttheme() {
|
|
|
1498
1505
|
default)
|
|
1499
1506
|
__tt_resolve "$2" || return 1
|
|
1500
1507
|
__tt_keep "$REPLY" ;;
|
|
1501
|
-
preview) __tt_preview ;;
|
|
1502
1508
|
pin)
|
|
1503
1509
|
if [[ $2 == ssh:* ]]; then
|
|
1504
1510
|
REPLY=ssh:${(L)2#ssh:}
|