Compare commits
1227 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04807453ec | ||
|
|
1b7582e85c | ||
|
|
e106562ef1 | ||
|
|
d3a20f00d6 | ||
|
|
de5443a4db | ||
|
|
e8b19e08fa | ||
|
|
a574081012 | ||
|
|
4f06ce9d72 | ||
|
|
6713580455 | ||
|
|
86f6c946b3 | ||
|
|
9194d1db6b | ||
|
|
420a1b018a | ||
|
|
8009b85073 | ||
|
|
2a58af2be9 | ||
|
|
4decac26f6 | ||
|
|
a6b74f190f | ||
|
|
bfbe60c90e | ||
|
|
384b2f8462 | ||
|
|
d875615c03 | ||
|
|
9aefcfe56f | ||
|
|
266e70222f | ||
|
|
d4639e2aea | ||
|
|
ca8975891b | ||
|
|
bed3d2eb50 | ||
|
|
78495a7f64 | ||
|
|
f66914f7bb | ||
|
|
58e1f6ee1f | ||
|
|
0625035202 | ||
|
|
f8fc272f58 | ||
|
|
6d61de8a8f | ||
|
|
4c08709df1 | ||
|
|
58a28da94d | ||
|
|
26b976d17d | ||
|
|
3141fc3f05 | ||
|
|
a45d6c8b55 | ||
|
|
dadf496a68 | ||
|
|
dae8ae33f0 | ||
|
|
b6254e4a67 | ||
|
|
53431c7ba8 | ||
|
|
afa0bb4c1d | ||
|
|
9ae2579dcb | ||
|
|
37fe98fdec | ||
|
|
fe91b74ba7 | ||
|
|
0fcc446298 | ||
|
|
e228f5105e | ||
|
|
719760fd7b | ||
|
|
d3e87bcd4f | ||
|
|
be771456e1 | ||
|
|
8514782ad2 | ||
|
|
a3e9e0f010 | ||
|
|
15615a4cd1 | ||
|
|
7246fb347c | ||
|
|
f1b6fb397b | ||
|
|
49fbeb9a56 | ||
|
|
f17d71454a | ||
|
|
59ea7485e4 | ||
|
|
ff63e58f95 | ||
|
|
79ec8b60b9 | ||
|
|
846c774ac2 | ||
|
|
940e311c74 | ||
|
|
251667a30e | ||
|
|
e45697f78a | ||
|
|
ea63efa522 | ||
|
|
60839cdb47 | ||
|
|
a867b4444d | ||
|
|
072fe91518 | ||
|
|
07e6171dc5 | ||
|
|
9a80fcee37 | ||
|
|
7731a558f0 | ||
|
|
7ea4c1e47f | ||
|
|
f6b748712c | ||
|
|
93abedd93f | ||
|
|
872cd7b2d5 | ||
|
|
a7e03f9c63 | ||
|
|
f53dfb27e2 | ||
|
|
36b4e0edd2 | ||
|
|
9081947751 | ||
|
|
f58013f2c6 | ||
|
|
ae35507f80 | ||
|
|
73ff508b51 | ||
|
|
b0ccf74029 | ||
|
|
6046dc8598 | ||
|
|
9bba38bd11 | ||
|
|
59505d17d5 | ||
|
|
bcecc61b67 | ||
|
|
f9af273150 | ||
|
|
8699f90fa4 | ||
|
|
0a9ba1bc08 | ||
|
|
37741ac808 | ||
|
|
6d790237c3 | ||
|
|
70d5a5134f | ||
|
|
ee166c5555 | ||
|
|
b965fb4806 | ||
|
|
e49b20bfa7 | ||
|
|
8abfb50aed | ||
|
|
10e0077a6f | ||
|
|
278477b387 | ||
|
|
58b7fb41d9 | ||
|
|
f71e0a6ee8 | ||
|
|
b59e42c9cc | ||
|
|
57888af4ea | ||
|
|
90f2ba474c | ||
|
|
09d025d88f | ||
|
|
e18ac4f0f5 | ||
|
|
63ab35ec7c | ||
|
|
d65ed5993c | ||
|
|
6436dfaf14 | ||
|
|
0c4bd96f87 | ||
|
|
6afabf7e2a | ||
|
|
a4d4cf5819 | ||
|
|
1be7425186 | ||
|
|
8f0825bc5c | ||
|
|
6a657eec33 | ||
|
|
ae952605d3 | ||
|
|
81753706d3 | ||
|
|
4120be3e2d | ||
|
|
832f73fde9 | ||
|
|
99d06f0714 | ||
|
|
e973c45968 | ||
|
|
4dbf0c89c3 | ||
|
|
1f264ffec5 | ||
|
|
547e4a3d7e | ||
|
|
d0fa0516f5 | ||
|
|
2c13005e0f | ||
|
|
b52990cb39 | ||
|
|
0a1390a7f6 | ||
|
|
5084f843c9 | ||
|
|
42b5b1cbf7 | ||
|
|
832f7a862b | ||
|
|
0d4a62ccb5 | ||
|
|
3d98501e57 | ||
|
|
a4fff7abe3 | ||
|
|
f51779d93a | ||
|
|
121d86fb1c | ||
|
|
5956639082 | ||
|
|
7e449dec4f | ||
|
|
a938b01246 | ||
|
|
a4cd10c6fb | ||
|
|
5fd17b4b99 | ||
|
|
8ae0ae2c93 | ||
|
|
59957a913a | ||
|
|
49d284cd16 | ||
|
|
dedbd14ace | ||
|
|
2c6d888b3d | ||
|
|
9b0a5d6465 | ||
|
|
32c4f4ccaa | ||
|
|
8e435dff16 | ||
|
|
98e44a8907 | ||
|
|
060362bee2 | ||
|
|
6bfe9bfe9a | ||
|
|
b4f7cd94a1 | ||
|
|
74f21ec774 | ||
|
|
5899e06b6b | ||
|
|
5f744368dd | ||
|
|
a4a9290577 | ||
|
|
77b15bf73f | ||
|
|
f41584c83b | ||
|
|
892b8c03eb | ||
|
|
ecdf901c19 | ||
|
|
5d1f58427e | ||
|
|
02a7316342 | ||
|
|
3d59e4eac1 | ||
|
|
50ce698524 | ||
|
|
32768e7939 | ||
|
|
62dbc1129c | ||
|
|
3d0d987984 | ||
|
|
2c78a22270 | ||
|
|
4a7ae0f524 | ||
|
|
bc25e5a8a2 | ||
|
|
4af2526f54 | ||
|
|
8f688fb33b | ||
|
|
6e351cd945 | ||
|
|
2d66e37dcb | ||
|
|
2da25d9187 | ||
|
|
11badac95d | ||
|
|
b4024bf7f2 | ||
|
|
759feac95b | ||
|
|
33de23d01d | ||
|
|
3f0ecbb241 | ||
|
|
e91c008357 | ||
|
|
7a2003c371 | ||
|
|
a7eb9850b7 | ||
|
|
f01446ff25 | ||
|
|
525a32be51 | ||
|
|
73386bd67f | ||
|
|
d1cf88e942 | ||
|
|
c11da595ef | ||
|
|
2546afb7aa | ||
|
|
56edb5cdbe | ||
|
|
bca3179a6d | ||
|
|
1f3d86a434 | ||
|
|
0456399ce5 | ||
|
|
799881af2d | ||
|
|
14047588ae | ||
|
|
9d9840a6d8 | ||
|
|
b36d8d6469 | ||
|
|
254ba401d4 | ||
|
|
3035ba08c3 | ||
|
|
16201ac873 | ||
|
|
42a2493286 | ||
|
|
6f48dda8b9 | ||
|
|
b8b495ac31 | ||
|
|
bd1276d079 | ||
|
|
bfb87854df | ||
|
|
f4aba9fc41 | ||
|
|
757c7900d9 | ||
|
|
3d2877eeb9 | ||
|
|
e04919098f | ||
|
|
5d05aeaace | ||
|
|
142b6fcc00 | ||
|
|
91c0f4e2d9 | ||
|
|
89a93af1d5 | ||
|
|
ef07e2941c | ||
|
|
0c3a8dadf6 | ||
|
|
6425715daf | ||
|
|
be110fb38c | ||
|
|
d743206b8c | ||
|
|
af7a104f5b | ||
|
|
c0b73986cb | ||
|
|
c48049a3bb | ||
|
|
1cb6250f14 | ||
|
|
8ed6ee97b2 | ||
|
|
1d88371604 | ||
|
|
8685558a2a | ||
|
|
d372b27ccd | ||
|
|
88410e032f | ||
|
|
622885853d | ||
|
|
0d3c7a64e2 | ||
|
|
0c274a9a0b | ||
|
|
0e5f51f195 | ||
|
|
49369d6279 | ||
|
|
bd288bd18f | ||
|
|
cdb1138465 | ||
|
|
c8c6f8691f | ||
|
|
9441cf15c3 | ||
|
|
276ed7263c | ||
|
|
6b38ca3bd2 | ||
|
|
c7bf54807e | ||
|
|
b28811846a | ||
|
|
5561aa1d37 | ||
|
|
8c0111cb08 | ||
|
|
0dc8bd5520 | ||
|
|
acdf06bf5d | ||
|
|
5e78b1c23e | ||
|
|
088b7cde4f | ||
|
|
6a8aeb2501 | ||
|
|
9c326397d0 | ||
|
|
28d89bdd53 | ||
|
|
69ba419afd | ||
|
|
afbaa36fd3 | ||
|
|
346ea8c8a0 | ||
|
|
4448444d4b | ||
|
|
daefb926d9 | ||
|
|
0a5c73dee4 | ||
|
|
cb09ae3e84 | ||
|
|
3d76c916a5 | ||
|
|
0a5ffe9b73 | ||
|
|
325603bf41 | ||
|
|
3e3744753d | ||
|
|
5bc2fa187c | ||
|
|
0a9005f5ce | ||
|
|
5d491b8067 | ||
|
|
16b4a4fa80 | ||
|
|
f6e0eb4005 | ||
|
|
a3370a1d18 | ||
|
|
2770a853f6 | ||
|
|
bd4399b5fc | ||
|
|
432df2089c | ||
|
|
d9d922546f | ||
|
|
00167cd9ab | ||
|
|
1692516955 | ||
|
|
0bcf73f980 | ||
|
|
e68914f46b | ||
|
|
fd331480fc | ||
|
|
ccf4a0e5e5 | ||
|
|
77aa3e7e11 | ||
|
|
716d588ba9 | ||
|
|
83041b1c97 | ||
|
|
e6311edf53 | ||
|
|
617316e8d9 | ||
|
|
bd21b79959 | ||
|
|
732ff7ee58 | ||
|
|
f081d6a421 | ||
|
|
3592a94517 | ||
|
|
e5de16bb01 | ||
|
|
a62e831932 | ||
|
|
b35dd5a869 | ||
|
|
ec28bd93c3 | ||
|
|
c44b5bb03f | ||
|
|
313add715c | ||
|
|
56ea741126 | ||
|
|
9dbdd58311 | ||
|
|
2ca13e886a | ||
|
|
314efe4f68 | ||
|
|
ebd2de042d | ||
|
|
c46c551fee | ||
|
|
cecca854c0 | ||
|
|
d7df4fa5dc | ||
|
|
3651a101d0 | ||
|
|
a97a05b1ec | ||
|
|
ee2520e036 | ||
|
|
88150b2012 | ||
|
|
9161c71b51 | ||
|
|
d7f569b341 | ||
|
|
5dfa02b45f | ||
|
|
45e629c56b | ||
|
|
ee437ca2d7 | ||
|
|
0293d957b2 | ||
|
|
89069407d2 | ||
|
|
495b29bf21 | ||
|
|
ec5165d958 | ||
|
|
1da8ad3839 | ||
|
|
e97afb3433 | ||
|
|
a824a45602 | ||
|
|
20e546b496 | ||
|
|
bf8e18441a | ||
|
|
c5af9613fd | ||
|
|
9ce807069a | ||
|
|
aa4fa4cc85 | ||
|
|
727c69ffdd | ||
|
|
b7a28afe7e | ||
|
|
12bcee3b78 | ||
|
|
f3376601f2 | ||
|
|
ecea1ba241 | ||
|
|
81467c2e7e | ||
|
|
889f2fce6d | ||
|
|
ae6318cb5a | ||
|
|
19e653ef1b | ||
|
|
d6949a7a3c | ||
|
|
5050a01856 | ||
|
|
564f865a63 | ||
|
|
c1cb196365 | ||
|
|
ca0fcada42 | ||
|
|
8e87b639fa | ||
|
|
fccba24f0b | ||
|
|
62e32ea108 | ||
|
|
b17fe747fc | ||
|
|
ccc2d7d2da | ||
|
|
a528b45d60 | ||
|
|
0c84285473 | ||
|
|
1df7400ad5 | ||
|
|
1cb65438fe | ||
|
|
cd5dd131d5 | ||
|
|
f0e8ab8f31 | ||
|
|
bfdb09d29f | ||
|
|
a81e5dd8a5 | ||
|
|
ddb1fcf430 | ||
|
|
646726b385 | ||
|
|
d47a80c8e8 | ||
|
|
5f4e326985 | ||
|
|
18e747babf | ||
|
|
a3ec988d07 | ||
|
|
b992a448b1 | ||
|
|
c29f50b0d6 | ||
|
|
d30ba9654f | ||
|
|
3e3dc26e3f | ||
|
|
a78138ab61 | ||
|
|
8fd5f184b7 | ||
|
|
fe075ea795 | ||
|
|
37b6677608 | ||
|
|
b91809eaa4 | ||
|
|
ca214ffe78 | ||
|
|
715925795f | ||
|
|
17a48f6b9f | ||
|
|
5c7a1d1b05 | ||
|
|
46e51811e8 | ||
|
|
34df7f6bc8 | ||
|
|
e8331b23d9 | ||
|
|
1a92f99831 | ||
|
|
6c95828e6e | ||
|
|
14142c320a | ||
|
|
727260e69b | ||
|
|
ad804cc01e | ||
|
|
dab51d33f5 | ||
|
|
77d7a6180f | ||
|
|
185669ec72 | ||
|
|
e68debc94e | ||
|
|
18ed56b639 | ||
|
|
dc2bac0068 | ||
|
|
005ab58b15 | ||
|
|
c0ff12a7de | ||
|
|
b11b04ef67 | ||
|
|
c8aba303e8 | ||
|
|
555efa4b70 | ||
|
|
da3c6945ae | ||
|
|
12c8fe32d5 | ||
|
|
053d9df0fe | ||
|
|
595ab448be | ||
|
|
86fec106e0 | ||
|
|
b9b50bf7b4 | ||
|
|
9abd5bf743 | ||
|
|
31bf212a60 | ||
|
|
624ef272fd | ||
|
|
7c59afbca9 | ||
|
|
67a92d7dc2 | ||
|
|
369f4125e1 | ||
|
|
aebf654e15 | ||
|
|
d936ede790 | ||
|
|
cd4ded6132 | ||
|
|
1603b4b522 | ||
|
|
0eac514e52 | ||
|
|
63399fe975 | ||
|
|
bc03b4dff6 | ||
|
|
cb2a99bd0e | ||
|
|
2cc3922108 | ||
|
|
e771e1ea8a | ||
|
|
6afaec1d62 | ||
|
|
80b5f31256 | ||
|
|
c96e6822e1 | ||
|
|
e4781b8af0 | ||
|
|
f3dd2a8bfd | ||
|
|
9fe9c74021 | ||
|
|
09c6c3e804 | ||
|
|
f5023e3269 | ||
|
|
2db7f559e3 | ||
|
|
b696d3f960 | ||
|
|
bc454b4417 | ||
|
|
aa6a800d1a | ||
|
|
536d6e00d9 | ||
|
|
725a04b321 | ||
|
|
3ff8cc58e1 | ||
|
|
4fc8267264 | ||
|
|
0965fc45f2 | ||
|
|
181178b0ea | ||
|
|
95e6e80921 | ||
|
|
f36b71350d | ||
|
|
3483722475 | ||
|
|
56e63baf5a | ||
|
|
0830e66e76 | ||
|
|
74a5d3a25e | ||
|
|
4fb29e1b6b | ||
|
|
2c4f616213 | ||
|
|
75afe7cd33 | ||
|
|
80eb78033f | ||
|
|
68013e8fe7 | ||
|
|
7fe32301c4 | ||
|
|
41ddc7d33f | ||
|
|
eff5840645 | ||
|
|
ddf0242f56 | ||
|
|
eae5c65d3e | ||
|
|
c85b545f8d | ||
|
|
f24dc80c49 | ||
|
|
9a9de0038c | ||
|
|
35626d3929 | ||
|
|
c8f26dd968 | ||
|
|
7e5cb50925 | ||
|
|
ffa755c723 | ||
|
|
a060bf7223 | ||
|
|
4ab5d97e9b | ||
|
|
81babd29e7 | ||
|
|
fac76ddedd | ||
|
|
f34cc1861a | ||
|
|
bd4ed38a3c | ||
|
|
8644fed534 | ||
|
|
ca9fdadf3c | ||
|
|
228364e317 | ||
|
|
e65aee4533 | ||
|
|
a1ca607f35 | ||
|
|
efbf156f82 | ||
|
|
a2533e9a46 | ||
|
|
09742af92b | ||
|
|
880de53d59 | ||
|
|
91a24dd2eb | ||
|
|
60e91b018a | ||
|
|
9be37f7d2d | ||
|
|
be79fc1c92 | ||
|
|
502960bfeb | ||
|
|
d95a00df73 | ||
|
|
b3a9c1a100 | ||
|
|
4318d2d7d0 | ||
|
|
c3ff888981 | ||
|
|
7c85616dcf | ||
|
|
353a48d913 | ||
|
|
4e736e83a3 | ||
|
|
57583d6b00 | ||
|
|
98dcb32a0c | ||
|
|
fba5e3a46d | ||
|
|
2122304515 | ||
|
|
80dbebf0ad | ||
|
|
0c160eab7b | ||
|
|
4841502959 | ||
|
|
8218df82f2 | ||
|
|
fadc1b539b | ||
|
|
c8162324ed | ||
|
|
2c46378886 | ||
|
|
cf7e43fa26 | ||
|
|
b5e8b5a124 | ||
|
|
6fa0a21b3c | ||
|
|
c43637f6cc | ||
|
|
f48a430493 | ||
|
|
a1eb341817 | ||
|
|
cc2419911c | ||
|
|
2f5d3b073d | ||
|
|
4c0a7a9566 | ||
|
|
35514e0cc3 | ||
|
|
0f23edeec3 | ||
|
|
69e54cb9c1 | ||
|
|
60b8023928 | ||
|
|
8099ae44d7 | ||
|
|
46f88494e3 | ||
|
|
4818ac0750 | ||
|
|
d96429e6b8 | ||
|
|
9cda076c93 | ||
|
|
d30c761b3b | ||
|
|
49a0e8e242 | ||
|
|
8630c7a700 | ||
|
|
905fbeec14 | ||
|
|
e1ec8dfe4f | ||
|
|
93558f75f2 | ||
|
|
7a66c1a01c | ||
|
|
9f7b975064 | ||
|
|
8e8a0d2df6 | ||
|
|
d9f4fadf2d | ||
|
|
3f3fe6b178 | ||
|
|
2e95cd7a62 | ||
|
|
9be7345ba6 | ||
|
|
950edb1110 | ||
|
|
c4b3723372 | ||
|
|
119841a2c4 | ||
|
|
2df6f9cdda | ||
|
|
55868da9d3 | ||
|
|
460373803d | ||
|
|
abf9cce6bf | ||
|
|
d9c400ac32 | ||
|
|
377607730c | ||
|
|
6da5a8073c | ||
|
|
68ad513dd5 | ||
|
|
40ff78b1c8 | ||
|
|
477baf390b | ||
|
|
76834c0975 | ||
|
|
a3b7a88e9c | ||
|
|
ce36b09593 | ||
|
|
ebaac70b27 | ||
|
|
b4a6ed8d8f | ||
|
|
7c161f2d78 | ||
|
|
39dcfb4e5d | ||
|
|
34d87b7a72 | ||
|
|
f2d2cfec8f | ||
|
|
46625d207b | ||
|
|
f35112378f | ||
|
|
bb5ded4e65 | ||
|
|
b2f406f021 | ||
|
|
7821e2508c | ||
|
|
3e6cfe3275 | ||
|
|
588313b9ac | ||
|
|
50e4811e6d | ||
|
|
c182f95684 | ||
|
|
c241524663 | ||
|
|
9517c3500d | ||
|
|
1b8978fede | ||
|
|
5796cbc040 | ||
|
|
49726384f7 | ||
|
|
e7386735f4 | ||
|
|
ddfa653197 | ||
|
|
fffee1049f | ||
|
|
cc502163cb | ||
|
|
d53d92b890 | ||
|
|
218582ced8 | ||
|
|
bc1c19b4f7 | ||
|
|
85cea78b3c | ||
|
|
7a9027a147 | ||
|
|
66db3f9764 | ||
|
|
7e84343f16 | ||
|
|
e82e57a30c | ||
|
|
336c7ddca8 | ||
|
|
4ffcbc8274 | ||
|
|
22673ebd90 | ||
|
|
b1c0398bba | ||
|
|
6310517ff2 | ||
|
|
4ff3d6a645 | ||
|
|
23570cc5f7 | ||
|
|
dc09a5183a | ||
|
|
8458b9e7d6 | ||
|
|
51900996ea | ||
|
|
663da130ae | ||
|
|
c8b1724ecf | ||
|
|
c289af8f07 | ||
|
|
da7fa53b1a | ||
|
|
d160db1bcd | ||
|
|
a788cd9f64 | ||
|
|
6997e36670 | ||
|
|
1893b3ce0f | ||
|
|
576abecf7d | ||
|
|
b9b799533b | ||
|
|
70a01955b8 | ||
|
|
5f9409a91d | ||
|
|
32805ca968 | ||
|
|
8dfb0c6675 | ||
|
|
7428d42c16 | ||
|
|
99d9cb0b0d | ||
|
|
80ab60f1b6 | ||
|
|
a1d24028b8 | ||
|
|
d03f4dbc98 | ||
|
|
f1573654b9 | ||
|
|
e703103fa8 | ||
|
|
6241369b6c | ||
|
|
2a637e4220 | ||
|
|
816360c275 | ||
|
|
c541d7e349 | ||
|
|
df70d8661a | ||
|
|
c3daa969fa | ||
|
|
66a7c3bc4d | ||
|
|
3553b3ce3d | ||
|
|
9289c2de69 | ||
|
|
dac1612cb0 | ||
|
|
87d79c7415 | ||
|
|
86d7aaa03a | ||
|
|
cae31ab336 | ||
|
|
2aa01c58a1 | ||
|
|
ee852cf5fc | ||
|
|
5eb87b9f10 | ||
|
|
820a893d75 | ||
|
|
ce823e4b08 | ||
|
|
21830048c9 | ||
|
|
1251f9ec80 | ||
|
|
4839cbe9d0 | ||
|
|
702bfccfa2 | ||
|
|
28386cc496 | ||
|
|
0c1a7347db | ||
|
|
c06a03ab96 | ||
|
|
93dbcab10a | ||
|
|
5f12fbc2ee | ||
|
|
2443dc135c | ||
|
|
40c046f86b | ||
|
|
aee5c317f6 | ||
|
|
0fdafd8398 | ||
|
|
3ca3c67828 | ||
|
|
336bc2c0e6 | ||
|
|
d3a3f99848 | ||
|
|
d31935b8eb | ||
|
|
13928d4d35 | ||
|
|
212af78032 | ||
|
|
60472fcee3 | ||
|
|
c899eb4ee3 | ||
|
|
d090db380f | ||
|
|
a26f041964 | ||
|
|
b22bda3cba | ||
|
|
69e903a4c4 | ||
|
|
6f19fd5912 | ||
|
|
9c2f96f7eb | ||
|
|
4494ddd8ff | ||
|
|
5cb36a4632 | ||
|
|
9b7342b231 | ||
|
|
01ebc8f15a | ||
|
|
472baf7337 | ||
|
|
c381716ecf | ||
|
|
0e08c6c660 | ||
|
|
6da79ab614 | ||
|
|
a44a3195ab | ||
|
|
f78feb5abf | ||
|
|
4385acd3c6 | ||
|
|
c0927a3643 | ||
|
|
37692119e1 | ||
|
|
0f193141af | ||
|
|
24d5fc5f15 | ||
|
|
1ab8d58bf7 | ||
|
|
691bf75b35 | ||
|
|
63e23d7fe3 | ||
|
|
23d0db5458 | ||
|
|
71c62664cd | ||
|
|
c9faf5dd59 | ||
|
|
baf080f147 | ||
|
|
0e29ee9299 | ||
|
|
d52e5fab1e | ||
|
|
9f442eb7e4 | ||
|
|
0d94ca5399 | ||
|
|
13b900faf7 | ||
|
|
32ad75c5ab | ||
|
|
7a45653575 | ||
|
|
b316e97a4f | ||
|
|
6c7420f4e7 | ||
|
|
80a357623d | ||
|
|
0a4dfa8fd2 | ||
|
|
4604558d35 | ||
|
|
089ab9ee9f | ||
|
|
4fb804efc6 | ||
|
|
5b2ba448b6 | ||
|
|
899b5078eb | ||
|
|
edd423aad6 | ||
|
|
518e0f4e21 | ||
|
|
7546e53c23 | ||
|
|
0f9944190d | ||
|
|
18aca275c8 | ||
|
|
6d02ef59f8 | ||
|
|
729cea88f3 | ||
|
|
9b957a1fdb | ||
|
|
e18b0cd4c8 | ||
|
|
b51be8382f | ||
|
|
a95a1f1158 | ||
|
|
be8fc47c5f | ||
|
|
4fd76b09d9 | ||
|
|
6546c1da9b | ||
|
|
8f0b3983ee | ||
|
|
7f2ce045ab | ||
|
|
38f1fe7742 | ||
|
|
a099d2364d | ||
|
|
5f91084968 | ||
|
|
cb9321e925 | ||
|
|
716ff187f9 | ||
|
|
16365f2014 | ||
|
|
0fa03da18c | ||
|
|
a4a7d49bed | ||
|
|
0de319fc73 | ||
|
|
c06823dd47 | ||
|
|
f9944e6140 | ||
|
|
426815f7ab | ||
|
|
2a842e36a1 | ||
|
|
90dfabc644 | ||
|
|
f302c2ae39 | ||
|
|
93aee3946f | ||
|
|
4b7de5d802 | ||
|
|
78c63e6a18 | ||
|
|
dcda2bff69 | ||
|
|
372c4da8f9 | ||
|
|
a95025752a | ||
|
|
a16ffcdde2 | ||
|
|
3c2e521dd7 | ||
|
|
f28d9bcd8c | ||
|
|
c6039fc399 | ||
|
|
706494016c | ||
|
|
a653233050 | ||
|
|
ed5accd702 | ||
|
|
3a247be758 | ||
|
|
d417aedde0 | ||
|
|
967aaad482 | ||
|
|
9c4942b190 | ||
|
|
67fd07a92a | ||
|
|
533b0ed591 | ||
|
|
3f1a0baa84 | ||
|
|
8057c420d9 | ||
|
|
a3717436b6 | ||
|
|
7852e0b618 | ||
|
|
5afb16ab8d | ||
|
|
8187ec2cef | ||
|
|
d55d8ac091 | ||
|
|
e13c34c2b8 | ||
|
|
8630c8830a | ||
|
|
da3f34603a | ||
|
|
97a8ff3478 | ||
|
|
2548896656 | ||
|
|
572df007df | ||
|
|
440640bbbc | ||
|
|
563b7ad2d0 | ||
|
|
b180702c97 | ||
|
|
c3f4e734f1 | ||
|
|
61a56a0561 | ||
|
|
820fb6dda9 | ||
|
|
85db87a121 | ||
|
|
dc11b76bea | ||
|
|
2b9408c217 | ||
|
|
5e033773dd | ||
|
|
855681200f | ||
|
|
456564f377 | ||
|
|
828e16b45d | ||
|
|
9289ebf9c9 | ||
|
|
f4b6cc6628 | ||
|
|
853f7cc59a | ||
|
|
5841776c65 | ||
|
|
fbf47f75d5 | ||
|
|
1b42f69119 | ||
|
|
a1b532334e | ||
|
|
edac0e8023 | ||
|
|
498d3d5906 | ||
|
|
57152a8e29 | ||
|
|
35d4e2d4e0 | ||
|
|
fe42b15ec6 | ||
|
|
1d4a86594b | ||
|
|
072e583835 | ||
|
|
463133abbe | ||
|
|
34d6c69b2a | ||
|
|
14d36e3727 | ||
|
|
ed95f7dfa0 | ||
|
|
f93a10da48 | ||
|
|
31e623afb3 | ||
|
|
2080b3d7fa | ||
|
|
a8e06a67c2 | ||
|
|
42a79cb269 | ||
|
|
1ba9cd6138 | ||
|
|
37f3328147 | ||
|
|
df1ecad7e9 | ||
|
|
5699c3ae7d | ||
|
|
1877a02378 | ||
|
|
e9f344c53f | ||
|
|
d15763f2ad | ||
|
|
76eab44f53 | ||
|
|
3a373a200c | ||
|
|
f6e518d2f9 | ||
|
|
14f9f64bce | ||
|
|
c79a0108a1 | ||
|
|
20fcc5e31b | ||
|
|
01299421ee | ||
|
|
5729e33412 | ||
|
|
f85f39e662 | ||
|
|
0e9be57119 | ||
|
|
ffd7b5779b | ||
|
|
1d1d55e2b4 | ||
|
|
3cea8f24d4 | ||
|
|
d6a43a7729 | ||
|
|
cfeeec95fa | ||
|
|
e6cff61f99 | ||
|
|
eeb02ceef4 | ||
|
|
eaa0ec4fc3 | ||
|
|
91a719f80e | ||
|
|
06f67e4765 | ||
|
|
7530bfd1a1 | ||
|
|
abf6a3f91d | ||
|
|
21d3856e90 | ||
|
|
2304d0ec5c | ||
|
|
5cafe198bf | ||
|
|
4ce2690bd2 | ||
|
|
ea186ac48d | ||
|
|
9ab5a03f53 | ||
|
|
7650c8bca9 | ||
|
|
3728d2cfd9 | ||
|
|
3214ba4541 | ||
|
|
4232904055 | ||
|
|
baf8976c2d | ||
|
|
b3ae857f3c | ||
|
|
8be0dd0d8e | ||
|
|
166ea9deb9 | ||
|
|
7a16ef2cc4 | ||
|
|
a0cee13652 | ||
|
|
a3b434d2fe | ||
|
|
36ab05f003 | ||
|
|
35dee0c46e | ||
|
|
cb1858ecc8 | ||
|
|
10fbf36e92 | ||
|
|
3c3e97aa6e | ||
|
|
f353380e86 | ||
|
|
b1375e5ed1 | ||
|
|
44bcbc4823 | ||
|
|
a402a3ad12 | ||
|
|
343eb56cdf | ||
|
|
3efa8b6322 | ||
|
|
7cd72f344d | ||
|
|
066dfc71aa | ||
|
|
769cd9be3f | ||
|
|
0f9d6a1e4a | ||
|
|
3c742a0037 | ||
|
|
9a3d99515f | ||
|
|
f3447d187d | ||
|
|
276696414e | ||
|
|
7d41aca0e4 | ||
|
|
c71d8fe1cc | ||
|
|
cc261db606 | ||
|
|
7e17ed21ce | ||
|
|
b1f4b2d8ed | ||
|
|
9cb5f6d9d7 | ||
|
|
f3177d8878 | ||
|
|
3bc7b5bad9 | ||
|
|
b70064d1be | ||
|
|
ffca2ecf19 | ||
|
|
a32b6d5cf5 | ||
|
|
3ce087a716 | ||
|
|
15cdeef552 | ||
|
|
a038477ce0 | ||
|
|
b05e939e05 | ||
|
|
6347daf0ac | ||
|
|
327f4ca327 | ||
|
|
fe0d1034aa | ||
|
|
d982a3c94e | ||
|
|
259ca4a11e | ||
|
|
b9ae1fa429 | ||
|
|
0d32c1656a | ||
|
|
2defd311e1 | ||
|
|
d078cb264a | ||
|
|
c45a656153 | ||
|
|
1cef544cff | ||
|
|
67cef371dc | ||
|
|
2fcfa8d3eb | ||
|
|
03391b4f7a | ||
|
|
2dae95bf0b | ||
|
|
558fad1630 | ||
|
|
c2641458e7 | ||
|
|
bbdfdb978d | ||
|
|
4112061a47 | ||
|
|
25e9ddb4a4 | ||
|
|
66bf39db93 | ||
|
|
be439cb887 | ||
|
|
f3b601aa06 | ||
|
|
f6a6ead0f3 | ||
|
|
43c04df98a | ||
|
|
581a373dae | ||
|
|
ca197a915c | ||
|
|
061111d822 | ||
|
|
41003d106a | ||
|
|
c9b1e66c71 | ||
|
|
17e95cb615 | ||
|
|
b5c086aedb | ||
|
|
1036132838 | ||
|
|
1d1d82ca50 | ||
|
|
85be3e4ed1 | ||
|
|
d5d52ec8b9 | ||
|
|
ecb0d1f325 | ||
|
|
68436c93a7 | ||
|
|
2a9dff2846 | ||
|
|
bcd1837924 | ||
|
|
77508bfe0d | ||
|
|
cf517effb3 | ||
|
|
901a075a38 | ||
|
|
76d6820af9 | ||
|
|
7cf73c10ac | ||
|
|
71963aa738 | ||
|
|
dcc0dabe68 | ||
|
|
348e632dd6 | ||
|
|
067502bd66 | ||
|
|
6b576fcf5c | ||
|
|
2fc972a173 | ||
|
|
a941b1af4e | ||
|
|
fbc8a1cdcb | ||
|
|
f0fab80f5b | ||
|
|
a0740d1616 | ||
|
|
8986d15a5b | ||
|
|
9f4f22743f | ||
|
|
9eebd2c921 | ||
|
|
5ce71506c8 | ||
|
|
ad5b43f6db | ||
|
|
aa9855516f | ||
|
|
fcd4649642 | ||
|
|
e12246983b | ||
|
|
e8e7ad3b75 | ||
|
|
e9d648d37c | ||
|
|
eaeece8177 | ||
|
|
aa9a991a85 | ||
|
|
0d37431def | ||
|
|
44dfd7a803 | ||
|
|
d2809a0acb | ||
|
|
4b074d723e | ||
|
|
deb6abe50e | ||
|
|
d042ea5ab9 | ||
|
|
bc7c1e4d05 | ||
|
|
a4c5e7c2ee | ||
|
|
504d915723 | ||
|
|
039ea95390 | ||
|
|
5f32d2e56f | ||
|
|
5b716df45f | ||
|
|
66e2e60ac4 | ||
|
|
69dc09489b | ||
|
|
33a6abfc07 | ||
|
|
f277cbf3f3 | ||
|
|
0a56ab7a1e | ||
|
|
a073936997 | ||
|
|
5c1dd69963 | ||
|
|
c08dc64581 | ||
|
|
5916bbd5b3 | ||
|
|
8c104b52f9 | ||
|
|
7266cb653d | ||
|
|
2a8fd278c1 | ||
|
|
4c25ceff29 | ||
|
|
26f0b53bb2 | ||
|
|
101377d7f2 | ||
|
|
2487f55bbc | ||
|
|
f69e718151 | ||
|
|
5d516a8584 | ||
|
|
b1322fbe04 | ||
|
|
38a5e38f88 | ||
|
|
78fd05c1c6 | ||
|
|
6993c905e3 | ||
|
|
14f8ce6e15 | ||
|
|
d726eb354d | ||
|
|
1136c64d49 | ||
|
|
3f3179db0c | ||
|
|
d224a4c39f | ||
|
|
3eee442f28 | ||
|
|
7c90812e51 | ||
|
|
5c8bcf9379 | ||
|
|
d40456d6a9 | ||
|
|
8e203af344 | ||
|
|
31ead3f088 | ||
|
|
efaeb0f0b2 | ||
|
|
9db9638bc3 | ||
|
|
74c1476f6d | ||
|
|
24255be0bd | ||
|
|
0d89eb2c40 | ||
|
|
2350952d05 | ||
|
|
53e38cb1d2 | ||
|
|
f9c99a61d4 | ||
|
|
2178c8e4af | ||
|
|
8aacf30f19 | ||
|
|
745e97e0ab | ||
|
|
af5c0b3b71 | ||
|
|
d7a1f3104a | ||
|
|
8fb48d7952 | ||
|
|
1ac3de4aeb | ||
|
|
0c5ea5c3c0 | ||
|
|
78e4f1cde4 | ||
|
|
fb0b94eaa1 | ||
|
|
7291fef7cc | ||
|
|
6db46850eb | ||
|
|
7997295d4c | ||
|
|
6daee3a0b5 | ||
|
|
87f6793552 | ||
|
|
40786427b0 | ||
|
|
59b84ae1a4 | ||
|
|
aafd8a8da4 | ||
|
|
5ff66f6bfa | ||
|
|
e8873804c0 | ||
|
|
0f37521592 | ||
|
|
8ad1180321 | ||
|
|
ced03c5d99 | ||
|
|
161a54ceaa | ||
|
|
c159ac287f | ||
|
|
4ddd2bf980 | ||
|
|
1d9425ecdc | ||
|
|
495981bade | ||
|
|
672cf9fffe | ||
|
|
72e15d8b4f | ||
|
|
075b4d252a | ||
|
|
1953ecdf4d | ||
|
|
89f8151579 | ||
|
|
d9cc1d67c0 | ||
|
|
d178f4c75d | ||
|
|
0668a3bf2a | ||
|
|
d548b21be2 | ||
|
|
ebcd053bf3 | ||
|
|
b282464604 | ||
|
|
42dcecde14 | ||
|
|
aa0b344b55 | ||
|
|
fa77128026 | ||
|
|
7f1c5d8534 | ||
|
|
d2a31a6a0f | ||
|
|
fb9c911ae9 | ||
|
|
5bc569c4dd | ||
|
|
8397970bf8 | ||
|
|
6fc7b3d946 | ||
|
|
0fe7796df0 | ||
|
|
40b50332de | ||
|
|
9a50dfc4b5 | ||
|
|
09c18f474f | ||
|
|
51244c4388 | ||
|
|
898f162369 | ||
|
|
2529ef2f0b | ||
|
|
fc528941bd | ||
|
|
8e9ee90d9f | ||
|
|
b03c6f70fe | ||
|
|
42da681f2b | ||
|
|
44561e8cea | ||
|
|
37735b962e | ||
|
|
34ec3eac44 | ||
|
|
59c14d07fd | ||
|
|
86ffb744f5 | ||
|
|
fab7cfb113 | ||
|
|
2715947830 | ||
|
|
eb2f3387c5 | ||
|
|
2472cea69f | ||
|
|
2a634af2bc | ||
|
|
81654c9874 | ||
|
|
28914d4450 | ||
|
|
4000cce81c | ||
|
|
35ad366427 | ||
|
|
c257adb56a | ||
|
|
929e0c126d | ||
|
|
b293e4d516 | ||
|
|
6571cf2e89 | ||
|
|
aa739cdfd4 | ||
|
|
35c608ae77 | ||
|
|
8d8095a2d1 | ||
|
|
1740821bb4 | ||
|
|
4cd6829657 | ||
|
|
ef76c075e0 | ||
|
|
b260a61c8f | ||
|
|
780e526143 | ||
|
|
1e0269faa2 | ||
|
|
73465aa44b | ||
|
|
1f5fa03015 | ||
|
|
000e1012c6 | ||
|
|
afc5821809 | ||
|
|
e8832a86bb | ||
|
|
f61b8608de | ||
|
|
92f428b6d1 | ||
|
|
8795bf8cf9 | ||
|
|
0dee0bfada | ||
|
|
482d3bb913 | ||
|
|
48035977e3 | ||
|
|
6b23921880 | ||
|
|
c98e4eb478 | ||
|
|
7cd05ad76b | ||
|
|
fa327d618d | ||
|
|
bc202aec6e | ||
|
|
606ce4e66f | ||
|
|
a10c19456a | ||
|
|
20688661aa | ||
|
|
cbbd9f475e | ||
|
|
f4b3948168 | ||
|
|
2245d4506f | ||
|
|
7f3da135e2 | ||
|
|
23f94b6e67 | ||
|
|
0ec10b52e0 | ||
|
|
2fcd57410a | ||
|
|
a993a71857 | ||
|
|
01ce0e1d1a | ||
|
|
040a152f1f | ||
|
|
f4f2013c2b | ||
|
|
6e172bdc09 | ||
|
|
725ec57bee | ||
|
|
8a9234ba4f | ||
|
|
a00e4ebe3f | ||
|
|
2d93a011df | ||
|
|
bffe7aba8f | ||
|
|
b581408137 | ||
|
|
2263cd1355 | ||
|
|
1bb87c71aa | ||
|
|
7dec7d615a | ||
|
|
2e5308ad40 | ||
|
|
d1015de700 | ||
|
|
934318adb1 | ||
|
|
179c2b21c0 | ||
|
|
85f6d3fed8 | ||
|
|
a4925eeeb4 | ||
|
|
196200d03f | ||
|
|
f2ca0424a0 | ||
|
|
07b971ad5f | ||
|
|
51fa25e03d | ||
|
|
bd5f100f13 | ||
|
|
3b8da7e4c2 | ||
|
|
4a9a021b2c | ||
|
|
d4dd226d8f | ||
|
|
0d4237f802 | ||
|
|
46b9aca16e | ||
|
|
4931477ef4 | ||
|
|
dfdd1697c5 | ||
|
|
801f0d51a1 | ||
|
|
bdebb19648 | ||
|
|
75df0cbcf5 | ||
|
|
e23b4ce6b4 | ||
|
|
1b88a68b55 | ||
|
|
a82bc6738c | ||
|
|
868626c79c | ||
|
|
e4cc8bf828 | ||
|
|
f57fb17d2b | ||
|
|
a69170b0ba | ||
|
|
4066c2389d | ||
|
|
cd7b4fcd8e | ||
|
|
b0c963b650 | ||
|
|
f67995d5d3 | ||
|
|
f0e7344bc8 | ||
|
|
aa525c68c7 | ||
|
|
a2e25331a5 | ||
|
|
d8f09d377f | ||
|
|
cc96cb1c75 | ||
|
|
5966f04656 | ||
|
|
dbce9a8f29 | ||
|
|
4333552523 | ||
|
|
c00e945f6e | ||
|
|
56cb628ee8 | ||
|
|
827b6598b2 | ||
|
|
59bafea06d | ||
|
|
d61aca40b8 | ||
|
|
bf704d35a2 | ||
|
|
fbc8881a96 | ||
|
|
8cfb1efb01 | ||
|
|
f399b8466c | ||
|
|
437ba69049 | ||
|
|
dbc7e8e85d | ||
|
|
f3333ce941 | ||
|
|
97a9261096 | ||
|
|
5a76dab3c6 | ||
|
|
5a92d3f312 | ||
|
|
b173dd1c39 | ||
|
|
473e1a6f22 | ||
|
|
9c4a890688 | ||
|
|
a803c8bcc5 | ||
|
|
5c7ce18379 | ||
|
|
aff6fdfa84 | ||
|
|
477a652b44 | ||
|
|
15e0b42f04 | ||
|
|
b25ea9c863 | ||
|
|
c838cb03c9 | ||
|
|
ba9adc127e | ||
|
|
b7d603c4de | ||
|
|
71f1f3aa64 | ||
|
|
7d1c26202a | ||
|
|
80db2f6558 | ||
|
|
e376c79dda | ||
|
|
5a47e0d2e4 | ||
|
|
ca9143bebc | ||
|
|
a49f6799de | ||
|
|
d916ecc4f3 | ||
|
|
e1ed9aca10 | ||
|
|
0e2f1b9405 | ||
|
|
db5a2d2141 | ||
|
|
a9771dccba | ||
|
|
4849e07c26 | ||
|
|
4645e78fa7 | ||
|
|
9e2590eb15 | ||
|
|
94575a5cf6 | ||
|
|
a597a8d86b | ||
|
|
3287798efe | ||
|
|
d01ac17334 | ||
|
|
2c96727c45 | ||
|
|
ca1b2454bd | ||
|
|
064fc17ce3 | ||
|
|
43ccf9cb41 | ||
|
|
96857a197c | ||
|
|
079ff7785c | ||
|
|
d6a6cbe153 | ||
|
|
2486cfd45d | ||
|
|
30cb7286db | ||
|
|
9e7253c179 | ||
|
|
276a82d1f7 | ||
|
|
57ced9bc83 | ||
|
|
3c3662b032 | ||
|
|
f490b9a8bd | ||
|
|
c7ccedae95 | ||
|
|
03517459db | ||
|
|
96326280e5 | ||
|
|
9b7899780b | ||
|
|
e01cd057e8 | ||
|
|
ba85ca1991 | ||
|
|
92a9b71f21 | ||
|
|
e50c26d1b9 | ||
|
|
7090c24321 | ||
|
|
55319cd6d6 | ||
|
|
8a6b51441c | ||
|
|
36670b49a0 | ||
|
|
a402d848d2 | ||
|
|
37c563802c | ||
|
|
2d7032973c | ||
|
|
70b5f5bce3 | ||
|
|
be34af4555 | ||
|
|
815539a933 | ||
|
|
ab889e2945 | ||
|
|
b3231c8003 | ||
|
|
5f6cb34f77 | ||
|
|
a99a080c50 | ||
|
|
4a1ca8d582 | ||
|
|
050eb5660d |
1
.github/FUNDING.yml
vendored
@@ -1,3 +1,4 @@
|
||||
github: kovidgoyal
|
||||
patreon: kovidgoyal
|
||||
liberapay: kovidgoyal
|
||||
custom: https://sw.kovidgoyal.net/kitty/support.html
|
||||
|
||||
11
.github/workflows/ci.py
vendored
@@ -34,18 +34,15 @@ def install_deps():
|
||||
run('brew', 'install', *items)
|
||||
else:
|
||||
run('sudo apt-get update')
|
||||
run('sudo apt-get install -y libgl1-mesa-dev libxi-dev libxrandr-dev libxinerama-dev'
|
||||
run('sudo apt-get install -y libgl1-mesa-dev libxi-dev libxrandr-dev libxinerama-dev ca-certificates'
|
||||
' libxcursor-dev libxcb-xkb-dev libdbus-1-dev libxkbcommon-dev libharfbuzz-dev libx11-xcb-dev'
|
||||
' libpng-dev liblcms2-dev libfontconfig-dev libxkbcommon-x11-dev libcanberra-dev uuid-dev')
|
||||
' libpng-dev liblcms2-dev libfontconfig-dev libxkbcommon-x11-dev libcanberra-dev librsync-dev uuid-dev')
|
||||
if is_bundle:
|
||||
install_bundle()
|
||||
else:
|
||||
if is_macos:
|
||||
# needed for zlib for pillow, should not be needed after pillow 8.0
|
||||
os.environ['PKG_CONFIG_PATH'] = '/usr/local/opt/zlib/lib/pkgconfig'
|
||||
cmd = 'pip3 install Pillow pygments'
|
||||
cmd = 'python3 -m pip install Pillow pygments'
|
||||
if sys.version_info[:2] < (3, 7):
|
||||
cmd += ' importlib-resources'
|
||||
cmd += ' importlib-resources dataclasses'
|
||||
run(cmd)
|
||||
|
||||
|
||||
|
||||
6
.github/workflows/ci.yml
vendored
@@ -20,15 +20,15 @@ jobs:
|
||||
cc: [gcc, clang]
|
||||
include:
|
||||
- python: a
|
||||
pyver: 3.6
|
||||
pyver: 3.7
|
||||
sanitize: 0
|
||||
|
||||
- python: b
|
||||
pyver: 3.7
|
||||
pyver: 3.8
|
||||
sanitize: 1
|
||||
|
||||
- python: c
|
||||
pyver: 3.8
|
||||
pyver: 3.9
|
||||
sanitize: 1
|
||||
|
||||
|
||||
|
||||
10
.github/workflows/codeql-analysis.yml
vendored
@@ -22,17 +22,11 @@ jobs:
|
||||
# a pull request then we can checkout the head.
|
||||
fetch-depth: 2
|
||||
|
||||
# If this run was triggered by a pull request event, then checkout
|
||||
# the head of the pull request instead of the merge commit.
|
||||
- run: git checkout HEAD^2
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
# with:
|
||||
# languages: go, javascript, csharp, python, cpp, java
|
||||
with:
|
||||
languages: python, c
|
||||
|
||||
- name: Build kitty
|
||||
run: python3 .github/workflows/ci.py build
|
||||
|
||||
1
.gitignore
vendored
@@ -19,3 +19,4 @@ __pycache__/
|
||||
/.mypy_cache
|
||||
.DS_Store
|
||||
bypy/b
|
||||
bypy/virtual-machines.conf
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
To build from source: <https://sw.kovidgoyal.net/kitty/build/>
|
||||
[To build from source](https://sw.kovidgoyal.net/kitty/build/)
|
||||
|
||||
Pre-built binaries: <https://sw.kovidgoyal.net/kitty/binary/>
|
||||
[Pre-built binaries](https://sw.kovidgoyal.net/kitty/binary/)
|
||||
|
||||
2
LICENSE
@@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
|
||||
47
__main__.py
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPL v3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
import os
|
||||
@@ -24,20 +23,34 @@ def remote_control(args: List[str]) -> None:
|
||||
|
||||
|
||||
def runpy(args: List[str]) -> None:
|
||||
if len(args) < 2:
|
||||
raise SystemExit('Usage: kitty +runpy "some python code"')
|
||||
sys.argv = ['kitty'] + args[2:]
|
||||
exec(args[1])
|
||||
|
||||
|
||||
def hold(args: List[str]) -> None:
|
||||
import subprocess
|
||||
import tty
|
||||
import termios
|
||||
from contextlib import suppress
|
||||
from kittens.tui.operations import init_state, set_cursor_visible
|
||||
ret = subprocess.Popen(args[1:]).wait()
|
||||
with suppress(BaseException):
|
||||
print('\n\x1b[1;32mPress any key to exit', end='', flush=True)
|
||||
print(
|
||||
'\n\x1b[1;32mPress Enter to exit',
|
||||
end=init_state(alternate_screen=False, kitty_keyboard_mode=False) + set_cursor_visible(False),
|
||||
flush=True)
|
||||
with suppress(BaseException):
|
||||
tty.setraw(sys.stdin.fileno())
|
||||
sys.stdin.buffer.read(1)
|
||||
fd = sys.stdin.fileno()
|
||||
old = termios.tcgetattr(fd)
|
||||
new = old[:]
|
||||
new[3] &= ~termios.ECHO # 3 == 'lflags'
|
||||
tcsetattr_flags = termios.TCSAFLUSH
|
||||
if hasattr(termios, 'TCSASOFT'):
|
||||
tcsetattr_flags |= getattr(termios, 'TCSASOFT')
|
||||
termios.tcsetattr(fd, tcsetattr_flags, new)
|
||||
with suppress(KeyboardInterrupt):
|
||||
input()
|
||||
raise SystemExit(ret)
|
||||
|
||||
|
||||
@@ -117,21 +130,21 @@ namespaced_entry_points['complete'] = complete
|
||||
|
||||
|
||||
def setup_openssl_environment() -> None:
|
||||
# Workaround for Linux distros that have still failed to get their heads
|
||||
# out of their asses and implement a common location for SSL certificates.
|
||||
# It's not that hard people, there exists a wonderful tool called the symlink
|
||||
# See https://www.mobileread.com/forums/showthread.php?t=256095
|
||||
if 'SSL_CERT_FILE' not in os.environ and 'SSL_CERT_DIR' not in os.environ:
|
||||
if os.access('/etc/pki/tls/certs/ca-bundle.crt', os.R_OK):
|
||||
os.environ['SSL_CERT_FILE'] = '/etc/pki/tls/certs/ca-bundle.crt'
|
||||
setattr(sys, 'kitty_ssl_env_var', 'SSL_CERT_FILE')
|
||||
elif os.path.isdir('/etc/ssl/certs'):
|
||||
os.environ['SSL_CERT_DIR'] = '/etc/ssl/certs'
|
||||
setattr(sys, 'kitty_ssl_env_var', 'SSL_CERT_DIR')
|
||||
# Use our bundled CA certificates instead of the system ones, since
|
||||
# many systems come with no certificates in a useable form or have various
|
||||
# locations for the certificates.
|
||||
d = os.path.dirname
|
||||
ext_dir: str = getattr(sys, 'kitty_extensions_dir')
|
||||
if 'darwin' in sys.platform.lower():
|
||||
cert_file = os.path.join(d(d(d(ext_dir))), 'cacert.pem')
|
||||
else:
|
||||
cert_file = os.path.join(d(ext_dir), 'cacert.pem')
|
||||
os.environ['SSL_CERT_FILE'] = cert_file
|
||||
setattr(sys, 'kitty_ssl_env_var', 'SSL_CERT_FILE')
|
||||
|
||||
|
||||
def main() -> None:
|
||||
if getattr(sys, 'frozen', False) and 'darwin' not in sys.platform.lower():
|
||||
if getattr(sys, 'frozen', False) and getattr(sys, 'kitty_extensions_dir', ''):
|
||||
setup_openssl_environment()
|
||||
first_arg = '' if len(sys.argv) < 2 else sys.argv[1]
|
||||
func = entry_points.get(first_arg)
|
||||
|
||||
@@ -30,6 +30,7 @@ def initialize_constants():
|
||||
kitty_constants['appname'] = re.search(
|
||||
r'appname: str\s+=\s+(u{0,1})[\'"]([^\'"]+)[\'"]', src
|
||||
).group(2)
|
||||
kitty_constants['cacerts_url'] = 'https://curl.haxx.se/ca/cacert.pem'
|
||||
return kitty_constants
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
image 'https://partner-images.canonical.com/core/xenial/current/ubuntu-xenial-core-cloudimg-{}-root.tar.gz'
|
||||
image 'https://cloud-images.ubuntu.com/releases/bionic/release/ubuntu-18.04-server-cloudimg-{}.img'
|
||||
|
||||
deps 'bison flex libxcursor-dev libxrandr-dev libxi-dev libxinerama-dev libgl1-mesa-dev libxcb-xkb-dev libfontconfig1-dev libdbus-1-dev'
|
||||
|
||||
@@ -19,7 +19,11 @@ from bypy.freeze import (
|
||||
from bypy.utils import get_dll_path, mkdtemp, py_compile, walk
|
||||
|
||||
j = os.path.join
|
||||
arch = 'x86_64' if is64bit else 'i686'
|
||||
machine = (os.uname()[4] or '').lower()
|
||||
if machine.startswith('arm64') or machine.startswith('aarch64'):
|
||||
arch = 'arm64'
|
||||
else:
|
||||
arch = 'x86_64' if is64bit else 'i686'
|
||||
self_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
py_ver = '.'.join(map(str, python_major_minor_version()))
|
||||
iv = globals()['init_env']
|
||||
@@ -29,7 +33,7 @@ kitty_constants = iv['kitty_constants']
|
||||
def binary_includes():
|
||||
return tuple(map(get_dll_path, (
|
||||
'expat', 'sqlite3', 'ffi', 'z', 'lzma', 'png16', 'lcms2', 'crypt',
|
||||
'iconv', 'pcre', 'graphite2', 'glib-2.0', 'freetype',
|
||||
'iconv', 'pcre', 'graphite2', 'glib-2.0', 'freetype', 'rsync',
|
||||
'harfbuzz', 'xkbcommon', 'xkbcommon-x11',
|
||||
'ncursesw', 'readline', 'brotlicommon', 'brotlienc', 'brotlidec'
|
||||
))) + (
|
||||
@@ -92,6 +96,15 @@ def copy_libs(env):
|
||||
subprocess.check_call(['chrpath', '-d', dest])
|
||||
|
||||
|
||||
def add_ca_certs(env):
|
||||
print('Downloading CA certs...')
|
||||
from urllib.request import urlopen
|
||||
cdata = urlopen(kitty_constants['cacerts_url']).read()
|
||||
dest = os.path.join(env.lib_dir, 'cacert.pem')
|
||||
with open(dest, 'wb') as f:
|
||||
f.write(cdata)
|
||||
|
||||
|
||||
def copy_python(env):
|
||||
print('Copying python...')
|
||||
srcdir = j(PREFIX, 'lib/python' + py_ver)
|
||||
@@ -106,8 +119,7 @@ def copy_python(env):
|
||||
shutil.copy2(y, env.py_dir)
|
||||
|
||||
srcdir = j(srcdir, 'site-packages')
|
||||
site_packages_dir = j(env.py_dir, 'site-packages')
|
||||
import_site_packages(srcdir, site_packages_dir)
|
||||
import_site_packages(srcdir, env.py_dir)
|
||||
|
||||
pdir = os.path.join(env.lib_dir, 'kitty-extensions')
|
||||
os.makedirs(pdir, exist_ok=True)
|
||||
@@ -220,6 +232,7 @@ def main():
|
||||
build_launcher(env)
|
||||
files = find_binaries(env)
|
||||
fix_permissions(files)
|
||||
add_ca_certs(env)
|
||||
if not args.dont_strip:
|
||||
strip_binaries(files)
|
||||
if not args.skip_tests:
|
||||
|
||||
@@ -170,6 +170,7 @@ class Freeze(object):
|
||||
self.add_stdlib()
|
||||
self.add_misc_libraries()
|
||||
self.freeze_python()
|
||||
self.add_ca_certs()
|
||||
if not self.dont_strip:
|
||||
self.strip_files()
|
||||
if not self.skip_tests:
|
||||
@@ -180,6 +181,15 @@ class Freeze(object):
|
||||
|
||||
return ret
|
||||
|
||||
@flush
|
||||
def add_ca_certs(self):
|
||||
print('\nDownloading CA certs...')
|
||||
from urllib.request import urlopen
|
||||
cdata = urlopen(kitty_constants['cacerts_url']).read()
|
||||
dest = os.path.join(self.contents_dir, 'Resources', 'cacert.pem')
|
||||
with open(dest, 'wb') as f:
|
||||
f.write(cdata)
|
||||
|
||||
@flush
|
||||
def strip_files(self):
|
||||
print('\nStripping files...')
|
||||
@@ -212,7 +222,7 @@ class Freeze(object):
|
||||
@flush
|
||||
def get_local_dependencies(self, path_to_lib):
|
||||
for x, is_id in self.get_dependencies(path_to_lib):
|
||||
for y in (PREFIX + '/lib/', PREFIX + '/python/Python.framework/'):
|
||||
for y in (PREFIX + '/lib/', PREFIX + '/python/Python.framework/', '@rpath/'):
|
||||
if x.startswith(y):
|
||||
if y == PREFIX + '/python/Python.framework/':
|
||||
y = PREFIX + '/python/'
|
||||
@@ -278,6 +288,7 @@ class Freeze(object):
|
||||
'lcms2.2',
|
||||
'crypto.1.1',
|
||||
'ssl.1.1',
|
||||
'rsync.2',
|
||||
):
|
||||
print('\nAdding', x)
|
||||
x = 'lib%s.dylib' % x
|
||||
|
||||
@@ -28,6 +28,15 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"name": "openssl",
|
||||
"unix": {
|
||||
"filename": "openssl-1.1.1i.tar.gz",
|
||||
"hash": "sha256:e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242",
|
||||
"urls": ["https://www.openssl.org/source/{filename}"]
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"name": "cmake",
|
||||
"os": "macos",
|
||||
@@ -48,25 +57,22 @@
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"name": "libxml2",
|
||||
"os": "linux",
|
||||
"unix": {
|
||||
"filename": "libxml2-2.9.10.tar.gz",
|
||||
"hash": "sha256:aafee193ffb8fe0c82d4afef6ef91972cbaf5feea100edc2f262750611b4be1f",
|
||||
"filename": "libxml2-2.9.12.tar.gz",
|
||||
"hash": "sha256:c8d6681e38c56f172892c85ddc0852e1fd4b53b4209e7f4ebf17f7e2eae71d92",
|
||||
"urls": ["ftp://xmlsoft.org/libxml2/{filename}"]
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"name": "xkbcommon",
|
||||
"os": "linux",
|
||||
"unix": {
|
||||
"filename": "libxkbcommon-1.0.3.tar.xz",
|
||||
"hash": "sha256:a2202f851e072b84e64a395212cbd976ee18a8ee602008b0bad02a13247dbc52",
|
||||
"urls": ["http://xkbcommon.org/download/{filename}"]
|
||||
"urls": ["https://xkbcommon.org/download/{filename}"]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -90,15 +96,6 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"name": "openssl",
|
||||
"unix": {
|
||||
"filename": "openssl-1.1.1i.tar.gz",
|
||||
"hash": "sha256:e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242",
|
||||
"urls": ["https://www.openssl.org/source/{filename}"]
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"name": "ncurses",
|
||||
"os": "linux",
|
||||
@@ -115,7 +112,7 @@
|
||||
"unix": {
|
||||
"filename": "readline-8.1.tar.gz",
|
||||
"hash": "sha256:f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02",
|
||||
"urls": ["http://ftp.gnu.org/gnu/readline/{filename}"]
|
||||
"urls": ["https://ftp.gnu.org/gnu/readline/{filename}"]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -128,6 +125,16 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"name": "librsync",
|
||||
"unix": {
|
||||
"filename": "librsync-2.3.2.tar.gz",
|
||||
"hash": "sha256:ef8ce23df38d5076d25510baa2cabedffbe0af460d887d86c2413a1c2b0c676f",
|
||||
"urls": ["https://github.com/librsync/librsync/releases/download/v2.3.2/{filename}"]
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"name": "xcrypt",
|
||||
"os": "linux",
|
||||
@@ -170,7 +177,7 @@
|
||||
"unix": {
|
||||
"filename": "libpng-1.6.37.tar.xz",
|
||||
"hash": "sha256:505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca",
|
||||
"urls": ["http://downloads.sourceforge.net/sourceforge/libpng/{filename}"]
|
||||
"urls": ["https://downloads.sourceforge.net/sourceforge/libpng/{filename}"]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -189,7 +196,7 @@
|
||||
"unix": {
|
||||
"filename": "graphite2-1.3.14.tgz",
|
||||
"hash": "sha256:f99d1c13aa5fa296898a181dff9b82fb25f6cc0933dbaa7a475d8109bd54209d",
|
||||
"urls": ["http://downloads.sourceforge.net/silgraphite/{filename}"]
|
||||
"urls": ["https://downloads.sourceforge.net/silgraphite/{filename}"]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -249,7 +256,7 @@
|
||||
"unix": {
|
||||
"filename": "fontconfig-2.13.1.tar.bz2",
|
||||
"hash": "sha256:f655dd2a986d7aa97e052261b36aa67b0a64989496361eca8d604e6414006741",
|
||||
"urls": ["http://www.fontconfig.org/release/{filename}"]
|
||||
"urls": ["https://www.fontconfig.org/release/{filename}"]
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
17
docs/_static/custom.css
vendored
@@ -5,6 +5,10 @@
|
||||
* Distributed under terms of the MIT license.
|
||||
*/
|
||||
|
||||
.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.sidebar-logo {
|
||||
max-height: 128px;
|
||||
}
|
||||
@@ -17,3 +21,16 @@
|
||||
.sidebar-tree a.current {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
details > summary {
|
||||
color: var(--color-link);
|
||||
cursor: pointer;
|
||||
text-decoration-color: var(--color-link-underline);
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
|
||||
/* pygments adds an underline to some white-space, this is particularly visible in
|
||||
* dark mode. Remove it. */
|
||||
.highlight .w {
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
2
docs/_static/custom.js
vendored
@@ -22,7 +22,7 @@ function scroll_sidebar_node_into_view(a) {
|
||||
a = a.offsetParent;
|
||||
if (!a || a == ss) break;
|
||||
}
|
||||
ss.scrollTop = pos;
|
||||
ss.scrollTo({top: pos, behavior: 'instant'});
|
||||
}
|
||||
|
||||
function mark_current_link(sidebar_tree, a, onload) {
|
||||
|
||||
@@ -4,6 +4,7 @@ Mappable actions
|
||||
.. highlight:: conf
|
||||
|
||||
The actions described below can be mapped to any key press or mouse action
|
||||
using the ``map`` and ``mouse_map`` directives in :file:`kitty.conf`.
|
||||
using the ``map`` and ``mouse_map`` directives in :file:`kitty.conf`. For
|
||||
configuration examples, see the default shortcut links for each action.
|
||||
|
||||
.. include:: /generated/actions.rst
|
||||
|
||||
@@ -11,16 +11,20 @@ windows are:
|
||||
Scrolling
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
======================== =======================
|
||||
========================= =======================
|
||||
Action Shortcut
|
||||
======================== =======================
|
||||
Scroll line up :sc:`scroll_line_up` (also :kbd:`⌥+⌘+⇞` and :kbd:`⌘+↑` on macOS)
|
||||
Scroll line down :sc:`scroll_line_down` (also :kbd:`⌥+⌘+⇟` and :kbd:`⌘+↓` on macOS)
|
||||
Scroll page up :sc:`scroll_page_up` (also :kbd:`⌘+⇞` on macOS)
|
||||
Scroll page down :sc:`scroll_page_down` (also :kbd:`⌘+⇟` on macOS)
|
||||
Scroll to top :sc:`scroll_home` (also :kbd:`⌘+↖` on macOS)
|
||||
Scroll to bottom :sc:`scroll_end` (also :kbd:`⌘+↘` on macOS)
|
||||
======================== =======================
|
||||
========================= =======================
|
||||
Line up :sc:`scroll_line_up` (also :kbd:`⌥+⌘+⇞` and :kbd:`⌘+↑` on macOS)
|
||||
Line down :sc:`scroll_line_down` (also :kbd:`⌥+⌘+⇟` and :kbd:`⌘+↓` on macOS)
|
||||
Page up :sc:`scroll_page_up` (also :kbd:`⌘+⇞` on macOS)
|
||||
Page down :sc:`scroll_page_down` (also :kbd:`⌘+⇟` on macOS)
|
||||
Top :sc:`scroll_home` (also :kbd:`⌘+↖` on macOS)
|
||||
Bottom :sc:`scroll_end` (also :kbd:`⌘+↘` on macOS)
|
||||
Previous shell prompt :sc:`scroll_to_previous_prompt` (see :ref:`shell_integration`)
|
||||
Next shell prompt :sc:`scroll_to_next_prompt` (see :ref:`shell_integration`)
|
||||
Browse scrollback in less :sc:`show_scrollback`
|
||||
Browse last cmd output :sc:`show_last_command_output` (see :ref:`shell_integration`)
|
||||
========================= =======================
|
||||
|
||||
Tabs
|
||||
~~~~~~~~~~~
|
||||
@@ -30,8 +34,8 @@ Action Shortcut
|
||||
======================== =======================
|
||||
New tab :sc:`new_tab` (also :kbd:`⌘+t` on macOS)
|
||||
Close tab :sc:`close_tab` (also :kbd:`⌘+w` on macOS)
|
||||
Next tab :sc:`next_tab` (also :kbd:`^+⇥` and :kbd:`⇧+⌘+]` on macOS)
|
||||
Previous tab :sc:`previous_tab` (also :kbd:`⇧+^+⇥` and :kbd:`⇧+⌘+[` on macOS)
|
||||
Next tab :sc:`next_tab` (also :kbd:`⌃+⇥` and :kbd:`⇧+⌘+]` on macOS)
|
||||
Previous tab :sc:`previous_tab` (also :kbd:`⇧+⌃+⇥` and :kbd:`⇧+⌘+[` on macOS)
|
||||
Next layout :sc:`next_layout`
|
||||
Move tab forward :sc:`move_tab_forward`
|
||||
Move tab backward :sc:`move_tab_backward`
|
||||
@@ -53,6 +57,8 @@ Previous window :sc:`previous_window`
|
||||
Move window forward :sc:`move_window_forward`
|
||||
Move window backward :sc:`move_window_backward`
|
||||
Move window to top :sc:`move_window_to_top`
|
||||
Visually focus window :sc:`focus_visible_window`
|
||||
Visually swap window :sc:`swap_with_window`
|
||||
Focus specific window :sc:`first_window`, :sc:`second_window` ... :sc:`tenth_window`
|
||||
(also :kbd:`⌘+1`, :kbd:`⌘+2` ... :kbd:`⌘+9` on macOS)
|
||||
(clockwise from the top-left)
|
||||
@@ -118,13 +124,13 @@ Paste from selection :sc:`paste_from_selection`
|
||||
Increase font size :sc:`increase_font_size` (also :kbd:`⌘++` on macOS)
|
||||
Decrease font size :sc:`decrease_font_size` (also :kbd:`⌘+-` on macOS)
|
||||
Restore font size :sc:`reset_font_size` (also :kbd:`⌘+0` on macOS)
|
||||
Toggle fullscreen :sc:`toggle_fullscreen` (also :kbd:`^+⌘+f` on macOS)
|
||||
Toggle fullscreen :sc:`toggle_fullscreen` (also :kbd:`⌃+⌘+f` on macOS)
|
||||
Toggle maximized :sc:`toggle_maximized`
|
||||
Input unicode character :sc:`input_unicode_character` (also :kbd:`^+⌘+space` on macOS)
|
||||
Input unicode character :sc:`input_unicode_character` (also :kbd:`⌃+⌘+space` on macOS)
|
||||
Click URL using the keyboard :sc:`open_url`
|
||||
Reset the terminal :sc:`reset_terminal`
|
||||
Reload :file:`kitty.conf` :sc:`reload_config_file` (also :kbd:`^+⌘+f5` on macOS)
|
||||
Debug :file:`kitty.conf` :sc:`debug_config` (also :kbd:`⌘+option+f6` on macOS)
|
||||
Reload :file:`kitty.conf` :sc:`reload_config_file` (also :kbd:`⌃+⌘+,` on macOS)
|
||||
Debug :file:`kitty.conf` :sc:`debug_config` (also :kbd:`⌘+⌥+f6` on macOS)
|
||||
Pass current selection to program :sc:`pass_selection_to_program`
|
||||
Edit |kitty| config file :sc:`edit_config_file`
|
||||
Open a |kitty| shell :sc:`kitty_shell`
|
||||
|
||||
@@ -22,6 +22,11 @@ The binaries will be installed in the standard location for your OS,
|
||||
Linux. The installer only touches files in that directory. To update kitty,
|
||||
simply re-run the command.
|
||||
|
||||
.. warning::
|
||||
**Do not** copy the kitty binary out of the installation folder. If you want
|
||||
to add it to your ``PATH`` create a symlink in :file:`~/.local/bin` or
|
||||
:file:`/usr/bin` or wherever.
|
||||
|
||||
|
||||
Manually installing
|
||||
---------------------
|
||||
@@ -63,6 +68,25 @@ particular desktop, but it should work for most major desktop environments.
|
||||
Customizing the installation
|
||||
--------------------------------
|
||||
|
||||
.. _nightly:
|
||||
|
||||
* You can install the latest nightly kitty build with ``installer``:
|
||||
|
||||
.. parsed-literal::
|
||||
:class: pre
|
||||
|
||||
|ins| \\
|
||||
installer=nightly
|
||||
|
||||
If you want to install it in parallel to the released kitty specify a
|
||||
different install locations with ``dest``:
|
||||
|
||||
.. parsed-literal::
|
||||
:class: pre
|
||||
|
||||
|ins| \\
|
||||
installer=nightly dest=/some/other/location
|
||||
|
||||
* You can specify a different install location, with ``dest``:
|
||||
|
||||
.. parsed-literal::
|
||||
@@ -88,6 +112,7 @@ Customizing the installation
|
||||
|ins| \\
|
||||
installer=/path/to/dmg or tarball
|
||||
|
||||
|
||||
Uninstalling
|
||||
----------------
|
||||
|
||||
|
||||
@@ -5,10 +5,14 @@ Build from source
|
||||
:alt: Build status
|
||||
:target: https://github.com/kovidgoyal/kitty/actions?query=workflow%3ACI
|
||||
|
||||
.. highlight:: sh
|
||||
|
||||
|kitty| is designed to run from source, for easy hack-ability. Make sure
|
||||
the following dependencies are installed first.
|
||||
|
||||
.. note::
|
||||
If you just want to test the latest changes to kitty you dont need to build
|
||||
from source. Instead install the :ref:`latest nightly build <nightly>`.
|
||||
|
||||
.. note::
|
||||
If you are making small changes only to the python parts of kitty, there is no need to
|
||||
@@ -30,6 +34,7 @@ Run-time dependencies:
|
||||
* ``zlib``
|
||||
* ``libpng``
|
||||
* ``liblcms2``
|
||||
* ``librsync``
|
||||
* ``freetype`` (not needed on macOS)
|
||||
* ``fontconfig`` (not needed on macOS)
|
||||
* ``libcanberra`` (not needed on macOS)
|
||||
@@ -41,10 +46,20 @@ Build-time dependencies:
|
||||
|
||||
* ``gcc`` or ``clang``
|
||||
* ``pkg-config``
|
||||
* For building on Linux in addition to the above dependencies you might also need to install the ``-dev`` packages for:
|
||||
``libdbus-1-dev``, ``libxcursor-dev``, ``libxrandr-dev``, ``libxi-dev``, ``libxinerama-dev``,
|
||||
``libgl1-mesa-dev``, ``libxkbcommon-x11-dev``, ``libfontconfig-dev``, ``libx11-xcb-dev``,
|
||||
``liblcms2-dev``, and ``libpython3-dev``, if they are not already installed by your distro.
|
||||
* For building on Linux in addition to the above dependencies you might also need to install the following packages, if they are not already installed by your distro:
|
||||
|
||||
- ``libdbus-1-dev``
|
||||
- ``libxcursor-dev``
|
||||
- ``libxrandr-dev``
|
||||
- ``libxi-dev``
|
||||
- ``libxinerama-dev``
|
||||
- ``libgl1-mesa-dev``
|
||||
- ``libxkbcommon-x11-dev``
|
||||
- ``libfontconfig-dev``
|
||||
- ``libx11-xcb-dev``
|
||||
- ``liblcms2-dev``
|
||||
- ``libpython3-dev``
|
||||
- ``librsync-dev``
|
||||
|
||||
|
||||
Install and run from source
|
||||
@@ -84,13 +99,18 @@ you might have to rebuild the app.
|
||||
`bypy framework <https://github.com/kovidgoyal/bypy>`_ however, that is
|
||||
designed to run on Linux and is not for the faint of heart.
|
||||
|
||||
|
||||
.. note::
|
||||
Apple disallows certain functionality, such as notifications for unsigned applications.
|
||||
If you need this functionality, you can try signing the built kitty.app with
|
||||
a self signed certificate, see for example, `here
|
||||
<https://stackoverflow.com/questions/27474751/how-can-i-codesign-an-app-without-being-in-the-mac-developer-program/27474942>`_.
|
||||
|
||||
.. note::
|
||||
If you are facing issues with ``linker`` while building,
|
||||
try with a ``brew`` installed python instead, see :iss:`289`
|
||||
for more discussion.
|
||||
|
||||
|
||||
Build and run from source with Nix
|
||||
-------------------------------------------
|
||||
|
||||
@@ -105,7 +125,9 @@ make them available in the newly spawned shell.
|
||||
Then proceed with ``make`` or ``make app`` according to the platform specific instructions above.
|
||||
|
||||
|
||||
Note for Linux/macOS packagers
|
||||
.. _packagers:
|
||||
|
||||
Notes for Linux/macOS packagers
|
||||
----------------------------------
|
||||
|
||||
The released |kitty| source code is available as a `tarball`_ from
|
||||
@@ -125,10 +147,21 @@ with :file:`linux-package/bin/kitty`. All the files needed to run kitty will be
|
||||
installed. You can choose a different staging area, by passing the ``--prefix``
|
||||
argument to :file:`setup.py`.
|
||||
|
||||
You should probably split |kitty| into two packages, :file:`kitty-terminfo` that
|
||||
installs the terminfo file and :file:`kitty` that installs the main program.
|
||||
This allows users to install the terminfo file on servers into which they ssh,
|
||||
without needing to install all of |kitty|.
|
||||
You should probably split |kitty| into three packages:
|
||||
|
||||
:code:`kitty-terminfo`
|
||||
installs the terminfo file
|
||||
|
||||
:code:`kitty-shell-integration`
|
||||
installs the shell integration scripts (the contents of the
|
||||
shell-integration directory in the kitty source code, probably to
|
||||
:file:`/usr/share/kitty/shell-integration`
|
||||
|
||||
:code:`kitty`
|
||||
installs the main program
|
||||
|
||||
This allows users to install the terminfo and shell integration files on
|
||||
servers into which they ssh, without needing to install all of |kitty|.
|
||||
|
||||
.. note::
|
||||
You need a couple of extra dependencies to build linux-package.
|
||||
@@ -143,7 +176,29 @@ This applies to creating packages for |kitty| for macOS package managers such as
|
||||
brew or MacPorts as well.
|
||||
|
||||
|
||||
.. note::
|
||||
Changing defaults for packages
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|kitty| has its defaults chosen to be suitable for a standalone distributable.
|
||||
If you are packaging it a few of these might need to be changed.
|
||||
|
||||
update-checking
|
||||
|kitty| has its own update check mechanism, if you would like to turn
|
||||
it off for your package, use
|
||||
``python3 setup.py linux-package --update-check-interval=0``
|
||||
it off for your package, use::
|
||||
|
||||
./setup.py linux-package --update-check-interval=0
|
||||
|
||||
shell-integration
|
||||
|kitty| by default injects its :ref:`shell_integration` code into the user's
|
||||
shell using environment variables or (for bash only) modifying
|
||||
the user's :file:`~/.bashrc` file.
|
||||
For a package, it might make more sense to distribute the shell
|
||||
integration scripts into the system-wide shell vendor locations. The
|
||||
shell integration files are found in the :file:`shell-integration`
|
||||
directory. Copy them to the system wide shell vendor locations for each
|
||||
shell, and use::
|
||||
|
||||
./setup.py linux-package --shell-integration=enabled\ no-rc
|
||||
|
||||
This will prevent kitty from modifying the user's shell environment to load
|
||||
the integration scripts.
|
||||
|
||||
@@ -4,8 +4,315 @@ Changelog
|
||||
|kitty| is a feature-rich, cross-platform, *fast*, GPU based terminal.
|
||||
To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
Recent major new features
|
||||
---------------------------
|
||||
|
||||
.. only:: dirhtml
|
||||
|
||||
A demo video
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
A new video showcasing some of kitty's many productivity enhancing features.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<video controls width="640" height="360">
|
||||
<source src="https://download.calibre-ebook.com/videos/kitty.mp4" type="video/mp4">
|
||||
<source src="https://download.calibre-ebook.com/videos/kitty.webm" type="video/webm">
|
||||
</video>
|
||||
|
||||
.. rst-class:: caption caption-text
|
||||
|
||||
Watch kitty in action!
|
||||
|
||||
|
||||
Shell integration
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
kitty automatically integrates with common shells to allow browsing the
|
||||
output of the previous command in a pager by pressing
|
||||
:sc:`show_last_command_output`, jumping to previous prompt locations in the
|
||||
scrollback by pressing :sc:`scroll_to_previous_prompt` and clicking with the
|
||||
mouse anywhere in the current command to move the cursor there. See
|
||||
:doc:`shell-integration` for details.
|
||||
|
||||
Logos for windows
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
kitty has the ability to display arbitrary ``PNG`` images at the corner
|
||||
of any kitty window to serve as a *logo* for quick window identification.
|
||||
Can be controlled via :opt:`window_logo_path` and also and changed via
|
||||
the :ref:`at_set-window-logo` remote control command.
|
||||
Useful to quickly identify special windows or just for some *bling*.
|
||||
|
||||
.. figure:: screenshots/window-logo.png
|
||||
:alt: A screenshot of the kitty shell window showing the kitty logo
|
||||
:align: center
|
||||
:width: 100%
|
||||
|
||||
A screenshot of the kitty shell window showing the kitty logo
|
||||
|
||||
|
||||
Visual keyboard based window select
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Select a kitty window visually using the keyboard, like the
|
||||
:doc:`kittens/hints`, but for kitty windows. Can also be used from shell
|
||||
scripts/third party integrations via the :ref:`at_select-window` remote control
|
||||
command.
|
||||
|
||||
.. figure:: screenshots/select-window.png
|
||||
:alt: A screenshot of the kitty select window function
|
||||
:align: center
|
||||
:width: 100%
|
||||
|
||||
Hints for selecting kitty windows visually
|
||||
|
||||
|
||||
|
||||
Detailed list of changes
|
||||
-------------------------------------
|
||||
|
||||
0.24.1 [2022-01-06]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Shell integration: Work around conflicts with some zsh plugins (:iss:`4428`)
|
||||
|
||||
- Have the zero width space and various other characters from the *Other,
|
||||
formatting* Unicode category be treated as combining characters (:iss:`4439`)
|
||||
|
||||
- Fix using ``--shell-integration`` with :file:`setup.py` broken (:iss:`4434`)
|
||||
|
||||
- Fix showing debug information not working if kitty's :file:`STDIN` is not a tty
|
||||
(:iss:`4424`)
|
||||
|
||||
- Linux: Fix a regression that broke rendering of emoji with variation selectors
|
||||
(:iss:`4444`)
|
||||
|
||||
|
||||
0.24.0 [2022-01-04]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Integrate kitty closely with common shells such as zsh, fish and bash.
|
||||
This allows lots of niceties such as jumping to previous prompts, opening the
|
||||
output of the last command in a new window, etc. See :ref:`shell_integration`
|
||||
for details. Packagers please read :ref:`packagers`.
|
||||
|
||||
- A new shortcut :sc:`focus_visible_window` to visually focus a window using
|
||||
the keyboard. Pressing it causes numbers to appear over each visible window
|
||||
and you can press the number to focus the corresponding window (:iss:`4110`)
|
||||
|
||||
- A new facility :opt:`window_logo_path` to draw an arbitrary PNG image as
|
||||
logo in the corner of a kitty window (:pull:`4167`)
|
||||
|
||||
- Allow rendering the cursor with a *reverse video* effect. See :opt:`cursor`
|
||||
for details (:iss:`126`)
|
||||
|
||||
- Allow rendering the mouse selection with a *reverse video* effect. See
|
||||
:opt:`selection_foreground` (:iss:`646`)
|
||||
|
||||
- A new option :opt:`tab_bar_align` to draw the tab bar centered or right
|
||||
aligned (:iss:`3946`)
|
||||
|
||||
- Allow the user to supply a custom Python function to draw tab bar. See
|
||||
:opt:`tab_bar_style`
|
||||
|
||||
- A new remote control command to :program:`change the tab color <kitty @
|
||||
set-tab-color>` (:iss:`1287`)
|
||||
|
||||
- A new remote control command to :program:`visually select a window <kitty @
|
||||
select-window>` (:iss:`4165`)
|
||||
|
||||
- Add support for reporting mouse events with pixel co-ordinates using the
|
||||
``SGR_PIXEL_PROTOCOL`` introduced in xterm 359
|
||||
|
||||
- When programs ask to read from the clipboard prompt, ask the user to allow
|
||||
the request by default instead of denying it by default. See
|
||||
:opt:`clipboard_control` for details (:iss:`4022`)
|
||||
|
||||
- A new mappable action ``swap_with_window`` to swap the current window with another window in the tab, visually
|
||||
|
||||
- A new :program:`remote control command <kitty @ set-enabled-layouts>` to change
|
||||
the enabled layouts in a tab (:iss:`4129`)
|
||||
|
||||
- A new option :opt:`bell_path` to specify the path to a sound file
|
||||
to use as the bell sound
|
||||
|
||||
- A new option :opt:`exe_search_path` to modify the locations kitty searches
|
||||
for executables to run (:iss:`4324`)
|
||||
|
||||
- broadcast kitten: Show a "fake" cursor in all windows being broadcast too
|
||||
(:iss:`4225`)
|
||||
|
||||
- Allow defining :opt:`aliases <action_alias>` for more general actions, not just kittens
|
||||
(:pull:`4260`)
|
||||
|
||||
- Fix a regression that caused :option:`kitty --title` to not work when
|
||||
opening new OS windows using :option:`kitty --single-instance` (:iss:`3893`)
|
||||
|
||||
- icat kitten: Fix display of JPEG images that are rotated via EXIF data and
|
||||
larger than available screen size (:iss:`3949`)
|
||||
|
||||
- macOS: Fix SIGUSR1 quitting kitty instead of reloading the config file (:iss:`3952`)
|
||||
|
||||
- Launch command: Allow specifying the OS window title
|
||||
|
||||
- broadcast kitten: Allow broadcasting :kbd:`ctrl+c` (:pull:`3956`)
|
||||
|
||||
- Fix space ligatures not working with Iosevka for some characters in the
|
||||
Enclosed Alphanumeric Supplement (:iss:`3954`)
|
||||
|
||||
- hints kitten: Fix a regression that caused using the default open program
|
||||
to trigger open actions instead of running the program (:iss:`3968`)
|
||||
|
||||
- Allow deleting environment variables in :opt:`env` by specifying
|
||||
just the variable name, without a value
|
||||
|
||||
- Fix :opt:`active_tab_foreground` not being honored when :opt:`tab_bar_style`
|
||||
is ``slant`` (:iss:`4053`)
|
||||
|
||||
- When a :opt:`tab_bar_background` is specified it should extend to the edges
|
||||
of the OS window (:iss:`4054`)
|
||||
|
||||
- Linux: Fix IME with fcitx5 not working after fcitx5 is restarted
|
||||
(:pull:`4059`)
|
||||
|
||||
- Various improvements to IME integration (:iss:`4219`)
|
||||
|
||||
- Remote file transfer: Fix transfer not working if custom ssh port or identity
|
||||
is specified on the command line (:iss:`4067`)
|
||||
|
||||
- Unicode input kitten: Implement scrolling when more results are found than
|
||||
the available display space (:pull:`4068`)
|
||||
|
||||
- Allow middle clicking on a tab to close it (:iss:`4151`)
|
||||
|
||||
- The command line option ``--watcher`` has been deprecated in favor of the
|
||||
:opt:`watcher` option in :file:`kitty.conf`. It has the advantage of
|
||||
applying to all windows, not just the initially created ones. Note that
|
||||
``--watcher`` now also applies to all windows, not just initially created ones.
|
||||
|
||||
- **Backward incompatibility**: No longer turn on the kitty extended keyboard
|
||||
protocol's disambiguate mode when the client sends the XTMODKEYS escape code.
|
||||
Applications must use the dedicated escape code to turn on the protocol.
|
||||
(:iss:`4075`)
|
||||
|
||||
- Fix soft hyphens not being preserved when round tripping text through the
|
||||
terminal
|
||||
|
||||
- macOS: Fix :kbd:`ctrl+shift` with :kbd:`Esc` or :kbd:`F1` - :kbd:`F12` not working
|
||||
(:iss:`4109`)
|
||||
|
||||
- macOS: Fix :opt:`resize_in_steps` not working correctly on high DPI screens
|
||||
(:iss:`4114`)
|
||||
|
||||
- Fix the :program:`resize OS Windows <kitty @ resize-os-window>` setting a
|
||||
slightly incorrect size on high DPI screens (:iss:`4114`)
|
||||
|
||||
- :program:`kitty @ launch` - when creating tabs with the ``--match`` option create
|
||||
the tab in the OS Window containing the result of the match rather than
|
||||
the active OS Window (:iss:`4126`)
|
||||
|
||||
- Linux X11: Add support for 10bit colors (:iss:`4150`)
|
||||
|
||||
- Fix various issues with changing :opt:`tab_bar_background` by remote control
|
||||
(:iss:`4152`)
|
||||
|
||||
- A new option :opt:`tab_bar_margin_color` to control the color of the tab bar
|
||||
margins
|
||||
|
||||
- A new option :opt:`visual_bell_color` to customize the color of the visual bell
|
||||
(:pull:`4181`)
|
||||
|
||||
- Add support for OSC 777 based desktop notifications
|
||||
|
||||
- Wayland: Fix pasting from applications that use a MIME type of "text/plain"
|
||||
rather than "text/plain;charset=utf-8" not working (:iss:`4183`)
|
||||
|
||||
- A new mappable action to close windows with a confirmation (:iss:`4195`)
|
||||
|
||||
- When remembering OS window sizes for full screen windows use the size before
|
||||
the window became fullscreen (:iss:`4221`)
|
||||
|
||||
- macOS: Fix keyboard input not working after toggling fullscreen till the
|
||||
window is clicked in
|
||||
|
||||
- A new mappable action ``nth_os_window`` to to focus the specified nth OS
|
||||
window. (:pull:`4316`)
|
||||
|
||||
- macOS: The kitty window can be scrolled by the mouse wheel when OS window not
|
||||
in focus. (:pull:`4371`)
|
||||
|
||||
- macOS: Light or dark system appearance can be specified in
|
||||
:opt:`macos_titlebar_color` and used in kitty themes. (:pull:`4378`)
|
||||
|
||||
|
||||
0.23.1 [2021-08-17]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- macOS: Fix themes kitten failing to download themes because of missing SSL
|
||||
root certificates (:iss:`3936`)
|
||||
|
||||
- A new option :opt:`clipboard_max_size` to control the maximum size
|
||||
of data that kitty will transmit to the system clipboard on behalf of
|
||||
programs running inside it (:iss:`3937`)
|
||||
|
||||
- When matching windows/tabs in kittens or using remote control, allow matching
|
||||
by recency. ``recent:0`` matches the active window/tab, ``recent:1`` matches
|
||||
the previous window/tab and so on
|
||||
|
||||
- themes kitten: Fix only the first custom theme file being loaded correctly
|
||||
(:iss:`3938`)
|
||||
|
||||
|
||||
0.23.0 [2021-08-16]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- A new :doc:`themes kitten </kittens/themes>` to easily change kitty themes.
|
||||
Choose from almost two hundred themes in the `kitty themes repository
|
||||
<https://github.com/kovidgoyal/kitty-themes>`_
|
||||
|
||||
- A new style for the tab bar that makes tabs looks like the tabs in a physical
|
||||
tabbed file, see :opt:`tab_bar_style`
|
||||
|
||||
- Make the visual bell flash more gentle, especially on dark themes
|
||||
(:pull:`2937`)
|
||||
|
||||
- Fix :option:`kitty --title` not overriding the OS Window title when multiple
|
||||
tabs are present. Also this option is no longer used as the default title for
|
||||
windows, allowing individual tabs/windows to have their own titles, even when
|
||||
the OS Window has a fixed overall title (:iss:`3893`)
|
||||
|
||||
- Linux: Fix some very long ligatures being rendered incorrectly at some font
|
||||
sizes (:iss:`3896`)
|
||||
|
||||
- Fix shift+middle click to paste sending a mouse press event but no release
|
||||
event which breaks some applications that grab the mouse but cant handle
|
||||
mouse events (:iss:`3902`)
|
||||
|
||||
- macOS: When the language is set to English and the country to one for which
|
||||
an English locale does not exist, set :envvar:`LANG` to ``en_US.UTF-8``
|
||||
(:iss:`3899`)
|
||||
|
||||
- terminfo: Fix "cnorm" the property for setting the cursor to normal using a
|
||||
solid block rather than a blinking block cursor (:iss:`3906`)
|
||||
|
||||
- Add :opt:`clear_all_mouse_actions` to clear all mouse actions defined to
|
||||
that point (:iss:`3907`)
|
||||
|
||||
- Fix the remote file kitten not working when using -- with ssh. The ssh kitten
|
||||
was recently changed to do this (:iss:`3929`)
|
||||
|
||||
- When dragging word or line selections, ensure the initially selected item is
|
||||
never deselected. This matches behavior in most other programs (:iss:`3930`)
|
||||
|
||||
- hints kitten: Make copy/paste with the :option:`kitty +kitten hints
|
||||
--program` option work when using the ``self``
|
||||
:option:`kitty +kitten hints --linenum-action` (:iss:`3931`)
|
||||
|
||||
|
||||
0.22.2 [2021-08-02]
|
||||
----------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- macOS: Fix a long standing bug that could cause kitty windows to stop
|
||||
updating, that got worse in the previous release (:iss:`3890` and
|
||||
@@ -16,7 +323,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.22.1 [2021-07-31]
|
||||
----------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Fix a regression in the previous release that broke ``kitty --help`` (:iss:`3869`)
|
||||
|
||||
@@ -39,7 +346,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.22.0 [2021-07-26]
|
||||
----------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Add a new :ref:`action-toggle_layout` action to easily zoom/unzoom a window
|
||||
|
||||
@@ -109,7 +416,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.21.2 [2021-06-28]
|
||||
----------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- A new :opt:`adjust_baseline` option to adjust the vertical alignment of text
|
||||
inside a line (:pull:`3734`)
|
||||
@@ -152,7 +459,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.21.1 [2021-06-14]
|
||||
----------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- macOS: Fix a regression in the previous release that broke rendering of
|
||||
strikeout (:iss:`3717`)
|
||||
@@ -165,7 +472,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.21.0 [2021-06-12]
|
||||
----------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Allow reloading the :file:`kitty.conf` config file by pressing
|
||||
:sc:`reload_config_file`. (:iss:`1292`)
|
||||
@@ -197,7 +504,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
- Unicode input kitten: Fix a regression in 0.20.0 that broke keyboard handling
|
||||
when the NumLock or CapsLock modifiers were engaged. (:iss:`3587`)
|
||||
|
||||
- Fix a regression in 0.20.0 that sent incorrect bytes for the :kbd:`F1-F4` keys
|
||||
- Fix a regression in 0.20.0 that sent incorrect bytes for the :kbd:`F1`-:kbd:`F4` keys
|
||||
in rmkx mode (:iss:`3586`)
|
||||
|
||||
- macOS: When the Apple Color Emoji font lacks an emoji glyph search for it in other
|
||||
@@ -258,7 +565,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.20.3 [2021-05-06]
|
||||
----------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- macOS: Distribute universal binaries with both ARM and Intel architectures
|
||||
|
||||
@@ -279,7 +586,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.20.2 [2021-04-28]
|
||||
----------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- A new protocol extension to :ref:`unscroll <unscroll>` text from the
|
||||
scrollback buffer onto the screen. Useful, for example, to restore
|
||||
@@ -319,7 +626,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.20.1 [2021-04-19]
|
||||
----------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- icat: Fix some broken GIF images with no frame delays not being animated
|
||||
(:iss:`3498`)
|
||||
@@ -332,7 +639,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.20.0 [2021-04-19]
|
||||
----------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Support display of animated images ``kitty +kitten icat animation.gif``. See
|
||||
:ref:`animation_protocol` for details on animation support in the kitty
|
||||
@@ -456,7 +763,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.19.3 [2020-12-19]
|
||||
-------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Happy holidays to all kitty users!
|
||||
|
||||
@@ -518,7 +825,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.19.2 [2020-11-13]
|
||||
-------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- A new :doc:`kittens/query_terminal` kitten to easily query the running kitty
|
||||
via escape codes to detect its version, and the values of
|
||||
@@ -561,7 +868,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.19.1 [2020-10-06]
|
||||
-------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- hints kitten: Add an ``ip`` type for easy selection of IP addresses
|
||||
(:pull:`3009`)
|
||||
@@ -573,7 +880,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.19.0 [2020-10-04]
|
||||
-------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Add support for `hyperlinks from terminal programs
|
||||
<https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda>`_.
|
||||
@@ -645,7 +952,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.18.3 [2020-08-11]
|
||||
-------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- hints kitten: Allow customizing hint colors (:pull:`2894`)
|
||||
|
||||
@@ -666,7 +973,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.18.2 [2020-07-28]
|
||||
--------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- X11: Improve handling of multiple keyboards. Now pressing a modifier key in
|
||||
one keyboard and a normal key in another works (:iss:`2362`). Don't rebuild
|
||||
@@ -731,13 +1038,13 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.18.1 [2020-06-23]
|
||||
--------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- macOS: Fix for diff kitten not working with python 3.8 (:iss:`2780`)
|
||||
|
||||
|
||||
0.18.0 [2020-06-20]
|
||||
--------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Allow multiple overlay windows per normal window
|
||||
|
||||
@@ -788,7 +1095,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.17.4 [2020-05-09]
|
||||
--------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Allow showing the name of the current layout and the number of windows
|
||||
in tab titles (:iss:`2634`)
|
||||
@@ -815,7 +1122,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.17.3 [2020-04-23]
|
||||
--------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Allow individually setting margins and padding for each edge (left, right,
|
||||
top, bottom). Margins can also be controlled per window via remote control
|
||||
@@ -869,7 +1176,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
- Fix :option:`--title` not being applied at window creation time (:iss:`2570`)
|
||||
|
||||
0.17.2 [2020-03-29]
|
||||
--------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Add a :option:`launch --watcher` option that allows defining callbacks
|
||||
that are called for various events in the window's life-cycle (:iss:`2440`)
|
||||
@@ -900,7 +1207,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.17.1 [2020-03-24]
|
||||
--------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Fix :opt:`cursor_underline_thickness` not working (:iss:`2465`)
|
||||
|
||||
@@ -915,7 +1222,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.17.0 [2020-03-24]
|
||||
--------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- :ref:`splits_layout` to arrange windows in arbitrary splits
|
||||
(:iss:`2308`)
|
||||
@@ -1006,7 +1313,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.16.0 [2020-01-28]
|
||||
--------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- A new :doc:`marks` feature that allows highlighting and scrolling to arbitrary
|
||||
text in the terminal window.
|
||||
@@ -1053,7 +1360,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
them. (:iss:`2310`)
|
||||
|
||||
0.15.1 [2019-12-21]
|
||||
--------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Fix a crash/incorrect rendering when detaching a window in some circumstances
|
||||
(:iss:`2173`)
|
||||
@@ -1078,7 +1385,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.15.0 [2019-11-27]
|
||||
--------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Add a new action :ref:`detach_window <detach_window>` that can be used to move the current
|
||||
window into a different tab (:iss:`1310`)
|
||||
@@ -1128,7 +1435,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.14.6 [2019-09-25]
|
||||
---------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- macOS: Fix a regression in the previous release that caused a crash when
|
||||
pressing a unprintable key, such as the POWER key (:iss:`1997`)
|
||||
@@ -1138,7 +1445,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.14.5 [2019-09-23]
|
||||
---------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Implement a hack to (mostly) preserve tabs when cat-ting a file with them and then
|
||||
copying the text or passing screen contents to another program (:iss:`1829`)
|
||||
@@ -1161,7 +1468,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
- Use selection foreground color for underlines as well (:iss:`1982`)
|
||||
|
||||
0.14.4 [2019-08-31]
|
||||
---------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- hints kitten: Add a :option:`kitty +kitten hints --alphabet` option to
|
||||
control what alphabets are used for hints (:iss:`1879`)
|
||||
@@ -1200,7 +1507,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.14.3 [2019-07-29]
|
||||
---------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Remote control: Add a command `kitty @ scroll-window` to scroll windows
|
||||
|
||||
@@ -1255,7 +1562,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.14.2 [2019-06-09]
|
||||
---------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Add an option :opt:`placement_strategy` to control how the cell area is
|
||||
aligned inside the window when the window size is not an exact multiple
|
||||
@@ -1297,7 +1604,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.14.1 [2019-05-29]
|
||||
---------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Add an option :opt:`command_on_bell` to run an arbitrary command when
|
||||
a bell occurs (:iss:`1660`)
|
||||
@@ -1332,7 +1639,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.14.0 [2019-05-24]
|
||||
---------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- macOS: The default behavior of the Option key has changed. It now generates
|
||||
unicode characters rather than acting as the :kbd:`Alt` modifier. See
|
||||
@@ -1467,7 +1774,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
characters not working well (:iss:`1616`)
|
||||
|
||||
0.13.3 [2019-01-19]
|
||||
------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- icat kitten: Add a ``--stdin`` option to control if image data is read from
|
||||
STDIN (:iss:`1308`)
|
||||
@@ -1505,7 +1812,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.13.2 [2019-01-04]
|
||||
------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Add a new option :opt:`tab_title_template` to control how tab titles
|
||||
are formatted. In particular the template can be used to display
|
||||
@@ -1547,7 +1854,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.13.1 [2018-12-06]
|
||||
------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Fix passing input via the pipe action to a program without a window not
|
||||
working.
|
||||
@@ -1560,7 +1867,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
be properly unwrapped (:iss:`1206`)
|
||||
|
||||
0.13.0 [2018-12-05]
|
||||
------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Add an option :opt:`scrollback_pager_history_size` to tell kitty to store
|
||||
extended scrollback to use when viewing the scrollback buffer in a pager
|
||||
@@ -1657,7 +1964,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
and slash characters in short URLs (:iss:`1201`)
|
||||
|
||||
0.12.3 [2018-09-29]
|
||||
------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- macOS: Fix kitty window not being rendered on macOS Mojave until the window is
|
||||
moved or resized at least once (:iss:`887`)
|
||||
@@ -1666,7 +1973,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.12.2 [2018-09-24]
|
||||
------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- A new ``last_used_layout`` function that can be mapped to a shortcut to
|
||||
switch to the previously used window layout (:iss:`870`)
|
||||
@@ -1733,7 +2040,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
mouse to malfunction when using multiple kitty windows (:iss:`1002`)
|
||||
|
||||
0.12.1 [2018-09-08]
|
||||
------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Add a new ``--start-in-fullscreen`` command line flag to start
|
||||
kitty in full screen mode (:iss:`856`)
|
||||
@@ -1776,7 +2083,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
a bug in the 0.12.0 macOS package
|
||||
|
||||
0.12.0 [2018-09-01]
|
||||
------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Preserve the mouse selection even when the contents of the screen are
|
||||
scrolled or overwritten provided the new text does not intersect the
|
||||
@@ -1786,7 +2093,8 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
using standard keyboards) via `IBus
|
||||
<https://github.com/ibus/ibus/wiki/ReadMe>`_ (:iss:`469`)
|
||||
|
||||
- Implement completion for the kitty command in bash and zsh
|
||||
- Implement completion for the kitty command in bash and zsh. See
|
||||
:ref:`shell_integration`.
|
||||
|
||||
- Render the text under the cursor in a fixed color, configurable via
|
||||
the option :opt:`cursor_text_color` (:iss:`126`)
|
||||
@@ -1850,7 +2158,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.11.3 [2018-07-10]
|
||||
------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Draw only the minimum borders needed for inactive windows. That is only the borders
|
||||
that separate the inactive window from a neighbor. Note that setting
|
||||
@@ -1884,7 +2192,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.11.2 [2018-07-01]
|
||||
------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Linux: Allow using XKB key names to bind shortcuts to keys not supported by GLFW (:pull:`665`)
|
||||
|
||||
@@ -1921,7 +2229,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.11.1 [2018-06-17]
|
||||
------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- diff kitten: Implement searching for text in the diff (:iss:`574`)
|
||||
|
||||
@@ -1949,7 +2257,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.11.0 [2018-06-12]
|
||||
------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- A new tab bar style "fade" in which each tab's edges fade into the background.
|
||||
See :opt:`tab_bar_style` and :opt:`tab_fade` for details. The old look can be
|
||||
@@ -2040,7 +2348,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.10.1 [2018-05-24]
|
||||
------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Add a kitten to easily ssh into servers that automatically copies the
|
||||
terminfo files over. ``kitty +kitten ssh myserver``.
|
||||
@@ -2065,7 +2373,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.10.0 [2018-05-21]
|
||||
------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- A diff kitten to show side-by-side diffs with syntax highlighting and support
|
||||
for images. See :doc:`diff kitten <kittens/diff>`.
|
||||
@@ -2115,7 +2423,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.9.1 [2018-05-05]
|
||||
------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Show a bell symbol on the tab if a bell occurs in one of the windows in the tab and
|
||||
the window is not the currently focused window
|
||||
@@ -2183,7 +2491,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.9.0 [2018-04-15]
|
||||
------------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- A new kitty command shell to allow controlling kitty via commands. Press
|
||||
`ctrl+shift+escape` to run the shell.
|
||||
@@ -2227,7 +2535,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.8.4 [2018-03-31]
|
||||
-----------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Fix presence of XDG_CONFIG_DIRS and absence of XDG_CONFIG_HOME preventing
|
||||
kitty from starting
|
||||
@@ -2237,7 +2545,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.8.3 [2018-03-29]
|
||||
-----------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Fix a regression that broke the visual bell and invert screen colors escape
|
||||
code
|
||||
@@ -2262,7 +2570,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.8.2 [2018-03-17]
|
||||
-----------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Allow extending existing selections by right clicking
|
||||
|
||||
@@ -2285,7 +2593,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
- Fix a crash when getting the contents of the scrollback buffer as text
|
||||
|
||||
0.8.1 [2018-03-09]
|
||||
-----------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Extend kitty's remote control feature to work over both UNIX and TCP sockets,
|
||||
so now you can control kitty from across the internet, if you want to.
|
||||
@@ -2317,7 +2625,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.8.0 [2018-02-24]
|
||||
-----------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- A framework for kittens, that is, small terminal programs designed to run
|
||||
inside kitty and extend its capabilities. Examples include unicode input and
|
||||
@@ -2362,7 +2670,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
new window/tab.
|
||||
|
||||
0.7.1 [2018-01-31]
|
||||
---------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Add an option to adjust the width of character cells
|
||||
|
||||
@@ -2374,7 +2682,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.7.0 [2018-01-24]
|
||||
---------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Allow controlling kitty from the shell prompt/scripts. You can
|
||||
open/close/rename windows and tabs and even send input to specific windows.
|
||||
@@ -2419,7 +2727,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.6.1 [2017-12-28]
|
||||
---------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Add an option to fade the text in inactive windows
|
||||
|
||||
@@ -2447,7 +2755,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.6.0 [2017-12-18]
|
||||
---------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Support background transparency via the background_opacity option. Provided
|
||||
that your OS/window manager supports transparency, you can now have kitty
|
||||
@@ -2498,7 +2806,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.5.1 [2017-12-01]
|
||||
---------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Add an option to control the thickness of lines in box drawing characters
|
||||
|
||||
@@ -2515,7 +2823,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.5.0 [2017-11-19]
|
||||
---------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Add support for ligature fonts such as Fira Code, Hasklig, etc. kitty now
|
||||
uses harfbuzz for text shaping which allow it to support advanced OpenType
|
||||
@@ -2549,7 +2857,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.4.2 [2017-10-23]
|
||||
---------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Fix a regression in 0.4.0 that broke custom key mappings
|
||||
|
||||
@@ -2560,7 +2868,7 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
|
||||
0.4.0 [2017-10-22]
|
||||
---------------------------
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Support for drawing arbitrary raster graphics (images) in the terminal via a
|
||||
new graphics protocol. kitty can draw images with full 32-bit color using both
|
||||
|
||||
36
docs/conf.py
@@ -21,8 +21,11 @@ from pygments.lexer import RegexLexer, bygroups # type: ignore
|
||||
from pygments.token import ( # type: ignore
|
||||
Comment, Keyword, Literal, Name, Number, String, Whitespace
|
||||
)
|
||||
from sphinx import addnodes, version_info # type: ignore
|
||||
from sphinx.util.logging import getLogger # type: ignore
|
||||
from sphinx import addnodes, version_info
|
||||
from sphinx.builders.html.transforms import KeyboardTransform
|
||||
from sphinx.util.logging import getLogger
|
||||
|
||||
KeyboardTransform.builders = ('html', 'dirhtml') # type: ignore
|
||||
|
||||
kitty_src = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
if kitty_src not in sys.path:
|
||||
@@ -98,13 +101,10 @@ rst_prolog = '''
|
||||
.. |kitty| replace:: *kitty*
|
||||
.. |version| replace:: VERSION
|
||||
.. _tarball: https://github.com/kovidgoyal/kitty/releases/download/vVERSION/kitty-VERSION.tar.xz
|
||||
.. role:: green
|
||||
.. role:: italic
|
||||
.. role:: bold
|
||||
.. role:: cyan
|
||||
.. role:: title
|
||||
|
||||
'''.replace('VERSION', str_version)
|
||||
smartquotes_action = 'qe' # educate quotes and ellipses but not dashes
|
||||
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
@@ -170,7 +170,9 @@ texinfo_documents = [
|
||||
|
||||
# GitHub linking inline roles {{{
|
||||
|
||||
def num_role(which: str, name: str, rawtext: str, text: str, lineno: int, inliner: Any, options: Any = {}, content: Any = []) -> Tuple[List, List]:
|
||||
def num_role(
|
||||
which: str, name: str, rawtext: str, text: str, lineno: int, inliner: Any, options: Any = {}, content: Any = []
|
||||
) -> Tuple[List[nodes.reference], List[nodes.problematic]]:
|
||||
' Link to a github issue '
|
||||
try:
|
||||
issue_num = int(text)
|
||||
@@ -188,7 +190,9 @@ def num_role(which: str, name: str, rawtext: str, text: str, lineno: int, inline
|
||||
return [node], []
|
||||
|
||||
|
||||
def commit_role(name: str, rawtext: str, text: str, lineno: int, inliner: Any, options: Any = {}, content: Any = []) -> Tuple[List, List]:
|
||||
def commit_role(
|
||||
name: str, rawtext: str, text: str, lineno: int, inliner: Any, options: Any = {}, content: Any = []
|
||||
) -> Tuple[List[nodes.reference], List[nodes.problematic]]:
|
||||
' Link to a github commit '
|
||||
try:
|
||||
commit_id = subprocess.check_output(
|
||||
@@ -264,7 +268,7 @@ def write_remote_control_protocol_docs() -> None: # {{{
|
||||
)
|
||||
field_pat = re.compile(r'\s*([a-zA-Z0-9_+]+)\s*:\s*(.+)')
|
||||
|
||||
def format_cmd(p: Callable, name: str, cmd: RemoteCommand) -> None:
|
||||
def format_cmd(p: Callable[..., None], name: str, cmd: RemoteCommand) -> None:
|
||||
p(name)
|
||||
p('-' * 80)
|
||||
lines = (cmd.__doc__ or '').strip().splitlines()
|
||||
@@ -304,7 +308,7 @@ def write_remote_control_protocol_docs() -> None: # {{{
|
||||
|
||||
# config file docs {{{
|
||||
|
||||
class ConfLexer(RegexLexer):
|
||||
class ConfLexer(RegexLexer): # type: ignore
|
||||
name = 'Conf'
|
||||
aliases = ['conf']
|
||||
filenames = ['*.conf']
|
||||
@@ -343,7 +347,7 @@ class ConfLexer(RegexLexer):
|
||||
}
|
||||
|
||||
|
||||
class SessionLexer(RegexLexer):
|
||||
class SessionLexer(RegexLexer): # type: ignore
|
||||
name = 'Session'
|
||||
aliases = ['session']
|
||||
filenames = ['*.session']
|
||||
@@ -359,7 +363,9 @@ class SessionLexer(RegexLexer):
|
||||
}
|
||||
|
||||
|
||||
def link_role(name: str, rawtext: str, text: str, lineno: int, inliner: Any, options: Any = {}, content: Any = []) -> Tuple[List, List]:
|
||||
def link_role(
|
||||
name: str, rawtext: str, text: str, lineno: int, inliner: Any, options: Any = {}, content: Any = []
|
||||
) -> Tuple[List[nodes.reference], List[nodes.problematic]]:
|
||||
text = text.replace('\n', ' ')
|
||||
m = re.match(r'(.+)\s+<(.+?)>', text)
|
||||
if m is None:
|
||||
@@ -376,7 +382,7 @@ def link_role(name: str, rawtext: str, text: str, lineno: int, inliner: Any, opt
|
||||
def expand_opt_references(conf_name: str, text: str) -> str:
|
||||
conf_name += '.'
|
||||
|
||||
def expand(m: Match) -> str:
|
||||
def expand(m: Match[str]) -> str:
|
||||
ref = m.group(1)
|
||||
if '<' not in ref and '.' not in ref:
|
||||
full_ref = conf_name + ref
|
||||
@@ -518,3 +524,7 @@ def setup(app: Any) -> None:
|
||||
app.add_role('pull', partial(num_role, 'pull'))
|
||||
app.add_role('disc', partial(num_role, 'discussions'))
|
||||
app.add_role('commit', commit_role)
|
||||
# monkey patch sphinx_inline_tabs to avoid a warning about parallel reads
|
||||
# see https://github.com/pradyunsg/sphinx-inline-tabs/issues/26
|
||||
inline_tabs = app.extensions['sphinx_inline_tabs']
|
||||
inline_tabs.parallel_read_safe = inline_tabs.parallel_write_safe = True
|
||||
|
||||
@@ -9,8 +9,9 @@ possibilities.
|
||||
|
||||
You can open the config file within kitty by pressing :sc:`edit_config_file`.
|
||||
You can reload the config file within kitty by pressing
|
||||
:sc:`reload_config_file` or sending kitty the ``SIGUSR1`` signal. You can also
|
||||
display the current configuration by pressing the :sc:`debug_config` key.
|
||||
:sc:`reload_config_file` (:kbd:`⌃+⌘+,` on macOS) or sending kitty the ``SIGUSR1`` signal.
|
||||
You can also display the current configuration by pressing the :sc:`debug_config`
|
||||
(:kbd:`⌘+⌥+f6` on macOS) key.
|
||||
|
||||
.. _confloc:
|
||||
|
||||
|
||||
99
docs/faq.rst
@@ -51,6 +51,9 @@ type it each time::
|
||||
|
||||
alias ssh="kitty +kitten ssh"
|
||||
|
||||
Remember to also setup :ref:`shell_integration` for completion and other
|
||||
niceties.
|
||||
|
||||
If for some reason that does not work (typically because the server is using a
|
||||
non POSIX compliant shell as ``/bin/sh``), you can try using it with ``python``
|
||||
instead::
|
||||
@@ -117,9 +120,14 @@ explicitly set a UTF-8 locale, like::
|
||||
How do I change the colors in a running kitty instance?
|
||||
------------------------------------------------------------
|
||||
|
||||
You can either use the
|
||||
`OSC terminal escape codes <https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands>`_
|
||||
to set colors or you can define keyboard shortcuts to set colors, for example::
|
||||
The easiest way to do it is to use the :doc:`themes kitten </kittens/themes>`,
|
||||
to choose a new color theme. Simply run::
|
||||
|
||||
kitty +kitten themes
|
||||
|
||||
And choose your theme from the list.
|
||||
|
||||
You can also define keyboard shortcuts to set colors, for example::
|
||||
|
||||
map f1 set_colors --configured /path/to/some/config/file/colors.conf
|
||||
|
||||
@@ -127,10 +135,9 @@ Or you can enable :doc:`remote control <remote-control>` for |kitty| and use :re
|
||||
The shortcut mapping technique has the same syntax as the remote control
|
||||
command, for details, see :ref:`at_set-colors`.
|
||||
|
||||
A list of pre-made color themes for kitty is available at:
|
||||
`kitty-themes <https://github.com/dexpota/kitty-themes>`_
|
||||
|
||||
Examples of using OSC escape codes to set colors::
|
||||
Additionally, You can use the
|
||||
`OSC terminal escape codes <https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands>`_
|
||||
to set colors. Examples of using OSC escape codes to set colors::
|
||||
|
||||
Change the default foreground color:
|
||||
printf '\x1b]10;#ff0000\x1b\\'
|
||||
@@ -185,13 +192,22 @@ If you do want to cat unknown data, use ``cat -v``.
|
||||
kitty is not able to use my favorite font?
|
||||
---------------------------------------------
|
||||
|
||||
|kitty| achieves its stellar performance by caching alpha masks of each rendered
|
||||
character on the GPU, so that every character needs to be rendered only once.
|
||||
This means it is a strictly character cell based display. As such it can use
|
||||
only monospace fonts, since every cell in the grid has to be the same size.
|
||||
|kitty| achieves its stellar performance by caching alpha masks of each
|
||||
rendered character on the GPU, and rendering them all in parallel. This means
|
||||
it is a strictly character cell based display. As such it can use only
|
||||
monospace fonts, since every cell in the grid has to be the same size.
|
||||
Furthermore, it needs fonts to be freely resizable, so it does not support
|
||||
bitmapped fonts.
|
||||
|
||||
.. note::
|
||||
If you are trying to use a font patched with NERD font symbols, dont do that
|
||||
as patching destroys fonts. There is no need, simply install the standalone
|
||||
NERD font, kitty should pick up symbols from it automatically, and you can
|
||||
tell it to do so explicitly in case it doesnt with the :opt:`symbol_map`
|
||||
directive::
|
||||
|
||||
symbol_map U+23FB-U+23FE,U+2B58,U+E200-U+E2A9,U+E0A0-U+E0A3,U+E0B0-U+E0BF,U+E0C0-U+E0C8,U+E0CC-U+E0CF,U+E0D0-U+E0D2,U+E0D4,U+E700-U+E7C5,U+F000-U+F2E0,U+2665,U+26A1,U+F400-U+F4A8,U+F67C,U+E000-U+E00A,U+F300-U+F313,U+E5FA-U+E62B Symbols Nerd Font
|
||||
|
||||
If your font is not listed in ``kitty list-fonts`` it means that it is not
|
||||
monospace or is a bitmapped font. On Linux you can list all monospace fonts with::
|
||||
|
||||
@@ -232,6 +248,37 @@ terminal) in different environments,
|
||||
see `here <https://github.com/kovidgoyal/kitty/issues/45>`_.
|
||||
|
||||
|
||||
I do not like the kitty icon!
|
||||
-------------------------------
|
||||
|
||||
There are many alternate icons available, click on an icon to visit its
|
||||
homepage:
|
||||
|
||||
.. image:: https://github.com/k0nserv/kitty-icon/raw/main/icon_512x512.png
|
||||
:target: https://github.com/k0nserv/kitty-icon
|
||||
:width: 256
|
||||
|
||||
.. image:: https://github.com/DinkDonk/kitty-icon/raw/main/kitty-dark.png
|
||||
:target: https://github.com/DinkDonk/kitty-icon
|
||||
:width: 256
|
||||
|
||||
.. image:: https://github.com/DinkDonk/kitty-icon/raw/main/kitty-light.png
|
||||
:target: https://github.com/DinkDonk/kitty-icon
|
||||
:width: 256
|
||||
|
||||
.. image:: https://github.com/hristost/kitty-alternative-icon/raw/main/kitty_icon.png
|
||||
:target: https://github.com/hristost/kitty-alternative-icon
|
||||
:width: 256
|
||||
|
||||
On macOS you can change the icon by following the steps:
|
||||
|
||||
#. Find :file:`kitty.app` in the Applications folder, select it and press :kbd:`⌘+i`
|
||||
#. Drag :file:`kitty.icns` onto the application icon in the kitty info pane
|
||||
#. Delete the icon cache and restart Dock::
|
||||
|
||||
$ rm /var/folders/*/*/*/com.apple.dock.iconcache; killall Dock
|
||||
|
||||
|
||||
How do I map key presses in kitty to different keys in the terminal program?
|
||||
--------------------------------------------------------------------------------------
|
||||
|
||||
@@ -253,7 +300,7 @@ How do I open a new window or tab with the same working directory as the current
|
||||
In :file:`kitty.conf` add the following::
|
||||
|
||||
map f1 launch --cwd=current
|
||||
map f2 launch --cwd=current --type=tab
|
||||
map f2 launch --cwd=current --type=tab
|
||||
|
||||
Pressing :kbd:`F1` will open a new kitty window with the same working directory
|
||||
as the current window. The :doc:`launch command <launch>` is very powerful,
|
||||
@@ -299,6 +346,9 @@ If you still want to use tmux, read on.
|
||||
Image display will not work, see `tmux issue
|
||||
<https://github.com/tmux/tmux/issues/1391>`_.
|
||||
|
||||
Using ancient versions of tmux such as 1.8 will
|
||||
cause gibberish on screen when pressing keys (:iss:`3541`).
|
||||
|
||||
If you are using tmux with multiple terminals or you start it under one
|
||||
terminal and then switch to another and these terminals have different TERM
|
||||
variables, tmux will break. You will need to restart it as tmux does not
|
||||
@@ -345,3 +395,28 @@ remaining used memory can be investigated using valgrind again, and it will
|
||||
come from arenas in the GPU drivers and the per thread arenas glibc's malloc
|
||||
maintains. These too allocate memory in large blocks and dont release it back
|
||||
to the OS immediately.
|
||||
|
||||
Why does kitty sometimes start slowly on my Linux system?
|
||||
-------------------------------------------------------------------------------------------
|
||||
|
||||
|kitty| takes no longer (within 100ms) to start than other similar GPU terminal
|
||||
emulators, (and may be faster than some). If |kitty| occasionally takes a long
|
||||
time to start, it could be a power management issue with the graphics card. On
|
||||
a multi-GPU system (which many modern laptops are, having a power efficient GPU
|
||||
that's built into the processor and a power hungry dedicated one that's usually
|
||||
off), even if the answer of the GPU will only be "don't use me".
|
||||
|
||||
For example, if you have a system with an AMD CPU and an NVIDIA GPU, and you
|
||||
know that you want to use the lower powered card to save battery life and
|
||||
because kitty does not require a powerful GPU to function, you can choose not
|
||||
to wake up the dedicated card, which has been reported on at least one system
|
||||
(:iss:`4292`) to take ≈2 seconds, by running |kitty| as::
|
||||
|
||||
MESA_LOADER_DRIVER_OVERRIDE=radeonsi __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json kitty
|
||||
|
||||
The correct command will depend on your situation and hardware.
|
||||
``__EGL_VENDOR_LIBRARY_FILENAMES`` instructs the GL dispatch library to use
|
||||
:file:`libEGL_mesa.so` and ignore :file:`libEGL_nvidia.so` also available on the
|
||||
system, which will wake the NVIDIA card during device enumeration.
|
||||
``MESA_LOADER_DRIVER_OVERRIDE`` also assures that Mesa won't offer any NVIDIA
|
||||
card during enumeration, and will instead just use `/lib/dri/radeonsi_dri.so`.
|
||||
|
||||
535
docs/file-transfer-protocol.rst
Normal file
@@ -0,0 +1,535 @@
|
||||
File transfer over the TTY
|
||||
===============================
|
||||
|
||||
There are sometimes situations where the TTY is the only convenient pipe
|
||||
between two connected systems, for example, nested SSH sessions, a serial
|
||||
line, etc. In such scenarios, it is useful to be able to transfer files
|
||||
over the TTY.
|
||||
|
||||
This protocol provides the ability to transfer regular files, directories and
|
||||
links (both symbolic and hard) preserving most of their metadata. It can
|
||||
optionally use compression and transmit only binary diffs to speed up
|
||||
transfers. However, since all data is base64 encoded for transmission over the
|
||||
TTY, this protocol will never be competitive with more direct file transfer
|
||||
mechanisms.
|
||||
|
||||
Overall design
|
||||
----------------
|
||||
|
||||
The basic design of this protocol is around transfer "sessions". Since
|
||||
untrusted software should not be able to read/write to another machines
|
||||
filesystem, a session must be approved by the user in the terminal emulator
|
||||
before any actual data is transmitted, unless a :ref:`pre-shared password is
|
||||
provided <bypass_auth>`.
|
||||
|
||||
There can be either send or receive sessions. In send sessions files are sent
|
||||
from remote client to the terminal emulator and vice versa for receive sessions.
|
||||
Every session basically consists of sending metadata for the files first and
|
||||
then sending the actual data. The session is a series of commands, every command
|
||||
carrying the session id (which should be a random unique-ish identifier, to
|
||||
avoid conflicts). The session is bi-directional with commands going both to and
|
||||
from the terminal emulator. Every command in a session also carries an
|
||||
``action`` field that specifies what the command does. The remaining fields in
|
||||
the command are dependent on the nature of the command.
|
||||
|
||||
Let's look at some simple examples of sessions to get a feel for the protocol.
|
||||
|
||||
|
||||
Sending files to the computer running the terminal emulator
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The client starts by sending a start send command::
|
||||
|
||||
→ action=send id=someid
|
||||
|
||||
It then waits for a status message from the terminal either
|
||||
allowing the transfer or refusing it. Until this message is received
|
||||
the client is not allowed to send any more commands for the session.
|
||||
The terminal emulator should drop a session if it receives any commands
|
||||
before sending an ``OK`` response. If the user accepts the transfer,
|
||||
the terminal will send::
|
||||
|
||||
← action=status id=someid status=OK
|
||||
|
||||
Or if the transfer is refused::
|
||||
|
||||
← action=status id=someid status=EPERM:User refused the transfer
|
||||
|
||||
The client then sends one or more ``file`` commands with the metadata of the file it wants
|
||||
to transfer::
|
||||
|
||||
→ action=file id=someid file_id=f1 name=/path/to/destination
|
||||
→ action=file id=someid file_id=f2 name=/path/to/destination2 ftype=directory
|
||||
|
||||
The terminal responds with either ``OK`` for directories or ``STARTED`` for
|
||||
files::
|
||||
|
||||
← action=status id=someid file_id=f1 status=STARTED
|
||||
← action=status id=someid file_id=f2 status=OK
|
||||
|
||||
If there was an error with the file, for example, if the terminal does not have
|
||||
permission to write to the specified location, it will instead respond with an
|
||||
error, such as::
|
||||
|
||||
← action=status id=someid file_id=f1 status=EPERM:No permission
|
||||
|
||||
The client sends data for files using ``data`` commands. It does not need to
|
||||
wait for the ``STARTED`` from the terminal for this, the terminal must discard data
|
||||
for files that are not ``STARTED``. Data for a file is sent in individual
|
||||
chunks of no larger than ``4096`` bytes. For example::
|
||||
|
||||
|
||||
→ action=data id=someid file_id=f1 data=chunk of bytes
|
||||
→ action=data id=someid file_id=f1 data=chunk of bytes
|
||||
...
|
||||
→ action=end_data id=someid file_id=f1 data=chunk of bytes
|
||||
|
||||
The sequence of data transmission for a file is ended with an ``end_data``
|
||||
command. After each data packet is received the terminal replies with
|
||||
an acknowledgement of the form::
|
||||
|
||||
← action=status id=someid file_id=f1 status=PROGRESS size=bytes written
|
||||
|
||||
After ``end_data`` the terminal replies with::
|
||||
|
||||
← action=status id=someid file_id=f1 status=OK size=bytes written
|
||||
|
||||
If an error occurs while writing the data, the terminal replies with an error
|
||||
code and ignores further commands about that file, for example::
|
||||
|
||||
← action=status id=someid file_id=f1 status=EIO:Failed to write to file
|
||||
|
||||
Once the client has finished sending as many files as it wants to, it ends
|
||||
the session with::
|
||||
|
||||
→ action=finish id=someid
|
||||
|
||||
At this point the terminal commits the session, applying file metadata,
|
||||
creating links, etc. If any errors occur it responds with an error message,
|
||||
such as::
|
||||
|
||||
← action=status id=someid status=Some error occurred
|
||||
|
||||
|
||||
Receiving files from the computer running terminal emulator
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The client starts by sending a start receive command::
|
||||
|
||||
→ action=receive id=someid size=num_of_paths
|
||||
|
||||
It then sends a list of ``num_of_paths`` paths it is interested in
|
||||
receiving::
|
||||
|
||||
→ action=file id=someid file_id=f1 name=/some/path
|
||||
→ action=file id=someid file_id=f2 name=/some/path2
|
||||
...
|
||||
|
||||
The client must then wait for responses from the terminal emulator. It
|
||||
is an error to send anymore commands to to the terminal until an ``OK``
|
||||
response is received from the terminal. The terminal wait for the user to accept
|
||||
the request. If accepted, it sends::
|
||||
|
||||
← action=status id=someid status=OK
|
||||
|
||||
If permission is denied it sends::
|
||||
|
||||
← action=status id=someid status=EPERM:User refused the transfer
|
||||
|
||||
The terminal then sends the metadata for all requested files. If any of them
|
||||
are directories, it traverses the directories recursively, listing all files.
|
||||
Note that symlinks must not be followed, but sent as symlinks::
|
||||
|
||||
← action=file id=someid file_id=f1 mtime=XXX permissions=XXX name=/absolute/path status=file_id1 size=size_in_bytes file_type=type parent=file_id of parent
|
||||
← action=file id=someid file_id=f1 mtime=XXX permissions=XXX name=/absolute/path2 status=file_id2 size=size_in_bytes file_type=type parent=file_id of parent
|
||||
...
|
||||
|
||||
Here the ``file_id`` field is set to the ``file_id`` value sent from the client
|
||||
and the ``status`` field is set to the actual file id for each file. This is
|
||||
because a file query sent from the client can result in multiple actual files if
|
||||
it is a directory. The ``parent`` field is the actual ``file_id`` of the directory
|
||||
containing this file and is set for entries that are generated from client
|
||||
requests that match directories. This allows the client to build an unambiguous picture
|
||||
of the file tree.
|
||||
|
||||
Once all the files are listed, the terminal sends an ``OK`` response that also
|
||||
specifies the absolute path to the home directory for the user account running
|
||||
the terminal::
|
||||
|
||||
← action=status id=someid status=OK name=/path/to/home
|
||||
|
||||
If an error occurs while listing any of the files asked for by the client,
|
||||
the terminal will send an error response like::
|
||||
|
||||
← action=status id=someid file_id=f1 status=ENOENT: Does not exist
|
||||
|
||||
Here, ``file_id`` is the same as was sent by the client in its initial query.
|
||||
|
||||
Now, the client can send requests for file data using the paths sent by the
|
||||
terminal emulator::
|
||||
|
||||
→ action=file id=someid file_id=f1 name=/some/path
|
||||
...
|
||||
|
||||
The terminal emulator replies with the data for the files, as a sequence of
|
||||
``data`` commands each with a chunk of data no larger than ``4096`` bytes,
|
||||
for each file (the terminal emulator should send the data for
|
||||
one file at a time)::
|
||||
|
||||
|
||||
← action=data id=someid file_id=f1 data=chunk of bytes
|
||||
...
|
||||
← action=end_data id=someid file_id=f1 data=chunk of bytes
|
||||
|
||||
If any errors occur reading file data, the terminal emulator sends an error
|
||||
message for the file, for example::
|
||||
|
||||
← action=status id=someid file_id=f1 status=EIO:Could not read
|
||||
|
||||
Once the client is done reading data for all the files it expects, it
|
||||
terminates the session with::
|
||||
|
||||
→ action=finished id=someid
|
||||
|
||||
Canceling a session
|
||||
----------------------
|
||||
|
||||
A client can decide to cancel a session at any time (for example if the user
|
||||
presses :kbd:`ctrl+c`). To cancel a session it sends a ``cancel`` action to the
|
||||
terminal emulator::
|
||||
|
||||
→ action=cancel id=someid
|
||||
|
||||
The terminal emulator drops the session and sends a cancel acknowledgement::
|
||||
|
||||
← action=status id=someid status=CANCELED
|
||||
|
||||
The client **must** wait for the canceled response from the emulator discarding
|
||||
any other responses till the cancel is received. If it does not wait, after
|
||||
it quits the responses might end up being printed to screen.
|
||||
|
||||
Quieting responses from the terminal
|
||||
-------------------------------------
|
||||
|
||||
The above protocol includes lots of messages from the terminal acknowledging
|
||||
receipt of data, granting permission etc., acknowledging cancel requests, etc.
|
||||
For extremely simple clients like shell scripts, it might be useful to suppress
|
||||
these responses, which can be done by adding the ``quiet`` key to the start
|
||||
session command::
|
||||
|
||||
→ action=send id=someid quiet=1
|
||||
|
||||
The key can take the values ``1`` - meaning suppress acknowledgement responses
|
||||
or ``2`` - meaning suppress all responses including errors. Only actual data
|
||||
responses are sent. Note that in particular this means acknowledgement of
|
||||
permission for the transfer to go ahead is suppressed, so this is typically
|
||||
useful only with :ref:`bypass_auth`.
|
||||
|
||||
.. _file_metadata:
|
||||
|
||||
File metadata
|
||||
-----------------
|
||||
|
||||
File metadata includes file paths, permissions and modification times. They are
|
||||
somewhat tricky as different operating systems support different kinds of
|
||||
metadata. This specification defines a common minimum set which should work
|
||||
across most operating systems.
|
||||
|
||||
File paths
|
||||
File paths must be valid UTF-8 encoded POSIX paths (i.e. using the forward slash
|
||||
``/`` as a separator). Linux systems allow non UTF-8 file paths, these
|
||||
are not supported. A leading ``~/`` means a path is relative to the
|
||||
``HOME`` directory. All path must be either absolute (i.e. with a leading
|
||||
``/``) or relative to the HOME directory. Individual components of the
|
||||
path must be no longer than 255 UTF-8 bytes. Total path length must be no
|
||||
more than 4096 bytes. Paths from Windows systems must use the forward slash
|
||||
as the separator, the first path component must be the drive letter with a
|
||||
colon. For example: :file:`C:\some\file.txt` is represented as
|
||||
:file:`/C:/some/file.txt`. For maximum portability, the following
|
||||
characters *should* be omitted from paths (however implementations are free
|
||||
to try to support them returning errors for non-representable paths)::
|
||||
|
||||
\ * : < > ? | /
|
||||
|
||||
File modification times
|
||||
Must be represented as the number of nanoseconds since the UNIX epoch. An
|
||||
individual file system may not store file metadata with this level of
|
||||
accuracy in which case it should use the closest possible approximation.
|
||||
|
||||
File permissions
|
||||
Represented as a number with the usual UNIX read, write and execute bits.
|
||||
In addition, the sticky, set-group-id and set-user-id bits may be present.
|
||||
Implementations should make a best effort to preserve as many bits as
|
||||
possible. On Windows, there is only a read-only bit. When reading file
|
||||
metadata all the ``WRITE`` bits should be set if the read only bit is clear
|
||||
and cleared if it is set. When writing files, the read-only bit should be
|
||||
set if the bit indicating write permission for the user is clear. The other
|
||||
UNIX bits must be ignored when writing. When reading, all the ``READ`` bits
|
||||
should always be set and all the ``EXECUTE`` bits should be set if the file is
|
||||
directly executable by the Windows Operating system. There is no attempt to
|
||||
map Window's ACLs to permission bits.
|
||||
|
||||
|
||||
Symbolic and hard links
|
||||
---------------------------
|
||||
|
||||
Symbolic and hard links can be preserved by this protocol.
|
||||
|
||||
.. note::
|
||||
In the following when target paths of symlinks are sent as actual paths, they must be
|
||||
encoded in the same way as discussed in :ref:`file_metadata`. It is up to
|
||||
the receiving side to translate them into appropriate paths for the local
|
||||
operating system. This may not always be possible, in which case either the
|
||||
symlink should not be created or a broken symlink should be created.
|
||||
|
||||
|
||||
Sending links to the terminal emulator
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
When sending files to the terminal emulator, the file command has the form::
|
||||
|
||||
→ action=file id=someid file_id=f1 name=/path/to/link file_type=link
|
||||
→ action=file id=someid file_id=f2 name=/path/to/symlink file_type=symlink
|
||||
|
||||
Then, when the client is sending data for the files, for hardlinks, the data
|
||||
will be the ``file_id`` of the target file (assuming the target file is also
|
||||
being transmitted, otherwise the hard link should be transmitted as a plain
|
||||
file)::
|
||||
|
||||
→ action=end_data id=someid file_id=f1 data=target_file_id_encoded_as_utf8
|
||||
|
||||
For symbolic links, the data is a little more complex. If the symbolic link is
|
||||
to a destination being transmitted, the data has the form::
|
||||
|
||||
→ action=end_data id=someid file_id=f1 data=fid:target_file_id_encoded_as_utf8
|
||||
→ action=end_data id=someid file_id=f1 data=fid_abs:target_file_id_encoded_as_utf8
|
||||
|
||||
The ``fid_abs`` form is used if the symlink uses an absolute path, ``fid`` if
|
||||
it uses a relative path. If the symlink is to a destination that is not being
|
||||
transmitted, then the prefix ``path:`` and the actual path in the symlink is
|
||||
transmitted.
|
||||
|
||||
Receiving links from the terminal emulator
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
When receiving files from the terminal emulator, link data is transmitted in
|
||||
two parts. First when the emulator sends the initial file listing to the
|
||||
client, the ``file_type`` is set to the link type and the ``data`` field is set
|
||||
to file_id of the target file if the target file is included in the listing.
|
||||
For example::
|
||||
|
||||
← action=file id=someid file_id=f1 status=file_id1 ...
|
||||
← action=file id=someid file_id=f1 status=file_id2 file_type=symlink data=file_id1 ...
|
||||
|
||||
Here the rest of the metadata has been left out for clarity. Notice that the
|
||||
second file is symlink whose ``data`` field is set to the file id of the first
|
||||
file (the value of the ``status`` field of the first file). The same technique
|
||||
is used for hard links.
|
||||
|
||||
The client should not request data for hard links, instead creating them
|
||||
directly after transmission is complete. For symbolic links the terminal
|
||||
must send the actual symbolic link target as a UTF-8 encoded path in the
|
||||
data field. The client can use this path either as-is (when the target is not
|
||||
a transmitted file) or to decide whether to create the symlink with a relative
|
||||
or absolute path when the target is a transmitted file.
|
||||
|
||||
|
||||
Transmitting binary deltas
|
||||
-----------------------------
|
||||
|
||||
Repeated transfer of large files that have only changed a little between
|
||||
the receiving and sending side can be sped up significantly by transmitting
|
||||
binary deltas of only the changed portions. This protocol has built-in support
|
||||
for doing that. This support uses the `rsync algorithm
|
||||
<https://github.com/librsync/librsync>`__. In this algorithm first the
|
||||
receiving side sends a file signature that contains hashes of blocks
|
||||
in the file. Then the sending side sends only those blocks that have changed.
|
||||
The receiving side applies these deltas to the file to update it till it matches
|
||||
the file on the sending side.
|
||||
|
||||
The modification to the basic protocol consists of setting the
|
||||
``transmission_type`` key to ``rsync`` when requesting a file. This triggers
|
||||
transmission of signatures and deltas instead of file data. The details are
|
||||
different for sending and receiving.
|
||||
|
||||
Sending to the terminal emulator
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
When sending the metadata of the file it wants to transfer, the client adds the
|
||||
``transmission_type`` key::
|
||||
|
||||
→ action=file id=someid file_id=f1 name=/path/to/destination transmission_type=rsync
|
||||
|
||||
The ``STARTED`` response from the terminal will have ``transmission_type`` set
|
||||
to ``rsync`` if the file exists and the terminal is able to send signature data::
|
||||
|
||||
← action=status id=someid file_id=f1 status=STARTED transmission_type=rsync
|
||||
|
||||
The terminal then transmits the signature using ``data`` commands::
|
||||
|
||||
← action=data id=someid file_id=f1 data=...
|
||||
...
|
||||
← action=end_data id=someid file_id=f1 data=...
|
||||
|
||||
Once the client receives and processes the full signature, it transmits the
|
||||
file delta to the terminal as ``data`` commands::
|
||||
|
||||
→ action=data id=someid file_id=f1 data=...
|
||||
→ action=data id=someid file_id=f1 data=...
|
||||
...
|
||||
→ action=end_data id=someid file_id=f1 data=...
|
||||
|
||||
The terminal then uses this delta to update the file.
|
||||
|
||||
Receiving from the terminal emulator
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
When the client requests file data from the terminal emulator, it can
|
||||
add the ``transmission_type=rsync`` key to indicate it will be sending
|
||||
a signature for that file::
|
||||
|
||||
→ action=file id=someid file_id=f1 name=/some/path transmission_type=rsync
|
||||
|
||||
The client then sends the signature using ``data`` commands::
|
||||
|
||||
→ action=data id=someid file_id=f1 data=...
|
||||
...
|
||||
→ action=end_data id=someid file_id=f1 data=...
|
||||
|
||||
After receiving the signature the terminal replies with the delta as a series
|
||||
of ``data`` commands::
|
||||
|
||||
← action=data id=someid file_id=f1 data=...
|
||||
...
|
||||
← action=end_data id=someid file_id=f1 data=...
|
||||
|
||||
The client then uses this delta to update the file.
|
||||
|
||||
The format of signatures and deltas
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
These come from `librsync <https://github.com/librsync/librsync>`__. If this
|
||||
specification gains wider adoption, these formats should be documented here.
|
||||
|
||||
Compression
|
||||
--------------
|
||||
|
||||
Individual files can be transmitted compressed if needed.
|
||||
Currently, only :rfc:`1950` ZLIB based deflate compression is
|
||||
supported, which is specified using the ``compression=zlib`` key when
|
||||
requesting a file. For example when sending files to the terminal emulator,
|
||||
when sending the file metadata the ``compression`` key can also be
|
||||
specified::
|
||||
|
||||
→ action=file id=someid file_id=f1 name=/path/to/destination compression=zlib
|
||||
|
||||
Similarly when receiving files from the terminal emulator, the final file
|
||||
command that the client sends to the terminal requesting the start of the
|
||||
transfer of data for the file can include the ``compression`` key::
|
||||
|
||||
→ action=file id=someid file_id=f1 name=/some/path compression=zlib
|
||||
|
||||
.. _bypass_auth:
|
||||
|
||||
Bypassing explicit user authorization
|
||||
------------------------------------------
|
||||
|
||||
In order to bypass the requirement of interactive user authentication,
|
||||
this protocol has the ability to use a pre-shared secret (password).
|
||||
When initiating a transfer session the client sends a hash of the password and
|
||||
the session id::
|
||||
|
||||
→ action=send id=someid bypass=sha256:hash_value
|
||||
|
||||
For example, suppose that the session id is ``mysession`` and the
|
||||
shared secret is ``mypassword``. Then the value of the ``bypass``
|
||||
key above is ``sha256:SHA256("mysession" + ";" + "mypassword")``, which
|
||||
is::
|
||||
|
||||
→ action=send id=mysession bypass=sha256:192bd215915eeaa8c2b2a4c0f8f851826497d12b30036d8b5b1b4fc4411caf2c
|
||||
|
||||
The value of ``bypass`` is of the form ``hash_function_name : hash_value``
|
||||
(without spaces). Currently, only the SHA256 hash function is supported.
|
||||
|
||||
.. warning::
|
||||
Hashing does not effectively hide the value of the password. So this
|
||||
functionality should only be used in secure/trusted contexts. While there
|
||||
exist hash functions harder to compute than SHA256, they are unsuitable as
|
||||
they will introduce a lot of latency to starting a session and in any case
|
||||
there is no mathematical proof that **any** hash function is not brute-forceable.
|
||||
|
||||
Encoding of transfer commands as escape codes
|
||||
------------------------------------------------
|
||||
|
||||
Transfer commands are encoded as ``OSC`` escape codes of the form::
|
||||
|
||||
<OSC> 5113 ; key=value ; key=value ... <ST>
|
||||
|
||||
Here ``OSC`` is the bytes ``0x1b 0x5d`` and ``ST`` is the bytes
|
||||
``0x1b 0x5c``. Keys are words containing only the characters ``[a-zA-Z0-9_]``
|
||||
and ``value`` is arbitrary data, whose encoding is dependent on the value of
|
||||
``key``. Unknown keys **must** be ignored when decoding a command.
|
||||
The number ``5113`` is a constant and is unused by any known OSC codes. It is
|
||||
the numeralization of the word ``file``.
|
||||
|
||||
|
||||
.. table:: The keys and value types for this protocol
|
||||
:align: left
|
||||
|
||||
================= ======== ============== =======================================================================
|
||||
Key Key name Value type Notes
|
||||
================= ======== ============== =======================================================================
|
||||
action ac enum send, file, data, end_data, receive, cancel, status, finish
|
||||
compression zip enum none, zlib
|
||||
file_type ft enum regular, directory, symlink, link
|
||||
transmission_type tt enum simple, rsync
|
||||
id id safe_string A unique-ish value, to avoid collisions
|
||||
file_id fid safe_string Must be unique per file in a session
|
||||
bypass pw safe_string hash of the bypass password and the session id
|
||||
quiet q integer 0 - verbose, 1 - only errors, 2 - totally silent
|
||||
mtime mod integer the modification time of file in nanoseconds since the UNIX epoch
|
||||
permissions prm integer the UNIX file permissions bits
|
||||
size sz integer size in bytes
|
||||
name n base64_string The path to a file
|
||||
status st base64_string Status messages
|
||||
parent pr safe_string The file id of the parent directory
|
||||
data d base64_bytes Binary data
|
||||
================= ======== ============== =======================================================================
|
||||
|
||||
The ``Key name`` is the actual serialized name of the key sent in the escape
|
||||
code. So for example, ``permissions=123`` is serialized as ``prm=123``. This
|
||||
is done to reduce overhead.
|
||||
|
||||
The value types are:
|
||||
|
||||
enum
|
||||
One from a permitted set of values, for example::
|
||||
|
||||
ac=file
|
||||
|
||||
safe_string
|
||||
A string consisting only of characters from the set ``[0-9a-zA-Z_:.,/!@#$%^&*()[]{}~`?"'\\|=+-]``
|
||||
Note that the semi-colon is missing from this set.
|
||||
|
||||
integer
|
||||
A base-10 number composed of the characters ``[0-9]`` with a possible
|
||||
leading ``-`` sign
|
||||
|
||||
base64_string
|
||||
A base64 encoded UTF-8 string using the standard base64 encoding
|
||||
|
||||
base64_bytes
|
||||
Binary data encoded using the standard base64 encoding
|
||||
|
||||
|
||||
An example of serializing an escape code is shown below::
|
||||
|
||||
action=send id=test name=somefile size=3 data=01 02 03
|
||||
|
||||
becomes::
|
||||
|
||||
<OSC> 5113 ; ac=send ; id=test ; n=c29tZWZpbGU= ; sz=3 ; d=AQID <ST>
|
||||
|
||||
Here ``c29tZWZpbGU`` is the base64 encoded form of somefile and ``AQID`` is the
|
||||
base64 encoded form of the bytes ``0x01 0x02 0x03``. The spaces in the encoded
|
||||
form are present for clarity and should be ignored.
|
||||
@@ -32,7 +32,7 @@ Glossary
|
||||
top of an existing kitty window, entirely covering it. Overlays are used
|
||||
throught kitty, for example, to display the :ref:`the scrollback buffer <scrollback>`,
|
||||
to display :doc:`hints </kittens/hints>`, for :doc:`unicode input
|
||||
</kittens/unicode-input>` etc.
|
||||
</kittens/unicode_input>` etc.
|
||||
|
||||
hyperlinks
|
||||
Terminals can have hyperlinks, just like the internet. In kitty you can
|
||||
@@ -52,6 +52,10 @@ Variables that influence kitty behavior
|
||||
files. Defaults to :file:`~/.config/kitty`. For full details of the config
|
||||
directory lookup mechanism see, :option:`kitty --config`.
|
||||
|
||||
.. envvar:: KITTY_CACHE_DIRECTORY
|
||||
|
||||
Controls where kitty stores cache files. Defaults to :file:`~/.cache/kitty`
|
||||
or :file:`~/Library/Caches/kitty` on macOS.
|
||||
|
||||
.. envvar:: VISUAL
|
||||
|
||||
@@ -63,15 +67,39 @@ Variables that influence kitty behavior
|
||||
|
||||
Same as :envvar:`VISUAL`. Used if :envvar:`VISUAL` is not set.
|
||||
|
||||
.. envvar:: GLFW_IM_MODULE
|
||||
|
||||
Set this to ``ibus`` to enable support for IME under X11.
|
||||
|
||||
.. envvar:: KITTY_WAYLAND_DETECT_MODIFIERS
|
||||
|
||||
When set to a non-empty value, kitty attempts to autodiscover XKB modifiers
|
||||
under Wayland. This is useful if using non-standard modifers like hyper. It
|
||||
is possible for the autodiscovery to fail; the default Wayland XKB mappings
|
||||
are used in this case. See :pull:`3943` for details.
|
||||
|
||||
|
||||
Variables that kitty sets when running child programs
|
||||
|
||||
.. envvar:: LANG
|
||||
|
||||
This is set only on macOS, and only if the country and language from the
|
||||
macOS user settings form a valid locale.
|
||||
|
||||
|
||||
.. envvar:: KITTY_WINDOW_ID
|
||||
|
||||
An integer that is the id for the kitty :term:`window` the program is running in.
|
||||
Can be used with the :doc:`kitty remote control facility <remote-control>`.
|
||||
|
||||
|
||||
.. envvar:: KITTY_PID
|
||||
|
||||
An integer that is the process id for the kitty process in which the program
|
||||
is running. Allows programs to tell kitty to reload its config by sending it
|
||||
the SIGUSR1 signal.
|
||||
|
||||
|
||||
.. envvar:: WINDOWID
|
||||
|
||||
The id for the :term:`OS Window <os_window>` the program is running in. Only available
|
||||
@@ -88,6 +116,11 @@ Variables that kitty sets when running child programs
|
||||
Path to a directory containing the kitty terminfo database.
|
||||
|
||||
|
||||
.. envvar:: KITTY_INSTALLATION_DIR
|
||||
|
||||
Path to the kitty installation directory.
|
||||
|
||||
|
||||
.. envvar:: COLORTERM
|
||||
|
||||
Set to the value ``truecolor`` to indicate that kitty supports 16 million
|
||||
@@ -120,3 +153,9 @@ Variables that kitty sets when running child programs
|
||||
|
||||
Set with the values of some common kitty options when running
|
||||
kittens, so kittens can use them without needing to load kitty.conf.
|
||||
|
||||
|
||||
.. envvar:: KITTY_SHELL_INTEGRATION
|
||||
|
||||
Set when enabling :ref:`shell_integration`. It is automatically removed by
|
||||
the shell integration scripts.
|
||||
|
||||
@@ -40,7 +40,13 @@ Some programs and libraries that use the kitty graphics protocol:
|
||||
* `ctx.graphics <https://ctx.graphics/>`_ - Library for drawing graphics
|
||||
* `timg <https://github.com/hzeller/timg>`_ - a terminal image and video viewer
|
||||
* `notcurses <https://github.com/dankamongmen/notcurses>`_ - C library for terminal graphics with bindings for C++, Rust and Python
|
||||
* `rasterm <https://github.com/BourgeoisBear/rasterm>`_ - Go library to display images in the the terminal
|
||||
* `rasterm <https://github.com/BourgeoisBear/rasterm>`_ - Go library to display images in the terminal
|
||||
* `chafa <https://github.com/hpjansson/chafa>`_ - a terminal image viewer
|
||||
* `hologram.nvim <https://github.com/edluffy/hologram.nvim>`_ - view images inside nvim
|
||||
|
||||
Other terminals that have implemented the graphics protocol:
|
||||
|
||||
* `WezTerm <https://github.com/wez/wezterm/issues/986>`_
|
||||
|
||||
|
||||
Getting the window size
|
||||
@@ -223,7 +229,7 @@ and can take the values:
|
||||
Value of `t` Meaning
|
||||
================== ============
|
||||
``d`` Direct (the data is transmitted within the escape code itself)
|
||||
``f`` A simple file
|
||||
``f`` A simple file (regular files only, not named pipes or similar)
|
||||
``t`` A temporary file, the terminal emulator will delete the file after reading the pixel data. For security reasons
|
||||
the terminal emulator should only delete the file if it
|
||||
is in a known temporary directory, such as :file:`/tmp`,
|
||||
@@ -238,6 +244,10 @@ Value of `t` Meaning
|
||||
close it on Windows.
|
||||
================== ============
|
||||
|
||||
When opening files, the terminal emulator must follow symlinks. In case of
|
||||
symlink loops or too many symlinks, it should fail and respond with an error,
|
||||
similar to reporting any other kind of I/O error.
|
||||
|
||||
Local client
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
@@ -316,9 +326,9 @@ use the *query action*, set ``a=q``. Then the terminal emulator will try to load
|
||||
the image and respond with either OK or an error, as above, but it will not
|
||||
replace an existing image with the same id, nor will it store the image.
|
||||
|
||||
While as of May 2020, kitty is the only terminal emulator to support this
|
||||
graphics protocol, we intend that any terminal emulator that wishes to support
|
||||
it can. To check if a terminal emulator supports the graphics protocol the best way
|
||||
As of September 2021, kitty and WezTerm are the only terminal emulators to support this
|
||||
graphics protocol. We intend that any terminal emulator that wishes to support
|
||||
it can do so. To check if a terminal emulator supports the graphics protocol the best way
|
||||
is to send the above *query action* followed by a request for the
|
||||
`primary device attributes <https://vt100.net/docs/vt510-rm/DA1.html>`_. If you
|
||||
get back an answer for the device attributes without getting back an answer for
|
||||
|
||||
@@ -19,7 +19,8 @@ kitty
|
||||
.. tab:: Fast
|
||||
|
||||
* Offloads rendering to the GPU for :doc:`lower system load <performance>`
|
||||
* Uses threaded rendering for absolutely minimal latency
|
||||
* Uses threaded rendering for
|
||||
`absolutely minimal latency <https://github.com/kovidgoyal/kitty/issues/2701#issuecomment-636497270>`_
|
||||
* Performance tradeoffs can be :ref:`tuned <conf-kitty-performance>`
|
||||
|
||||
.. tab:: Capable
|
||||
@@ -36,8 +37,9 @@ kitty
|
||||
|
||||
.. tab:: Composable
|
||||
|
||||
* Programmble tabs, :ref:`splits <splits_layout>` and multiple :doc:`layouts <layouts>` to manage windows
|
||||
* Browse the :ref:`entire history <scrollback>` or the output from the last command comfortably in pagers and editors
|
||||
* Programmable tabs, :ref:`splits <splits_layout>` and multiple :doc:`layouts <layouts>` to manage windows
|
||||
* Browse the :ref:`entire history <scrollback>` or the :sc:`output from the last command <show_last_command_output>`
|
||||
comfortably in pagers and editors
|
||||
* Edit or download :doc:`remote files <kittens/remote_file>` in an existing SSH session
|
||||
|
||||
.. tab:: Cross-platform
|
||||
@@ -55,12 +57,18 @@ kitty
|
||||
* Lots more in :doc:`protocol-extensions`
|
||||
|
||||
|
||||
.. figure:: screenshots/screenshot.png
|
||||
:alt: Screenshot, showing three programs in the 'Tall' layout
|
||||
:align: center
|
||||
:width: 100%
|
||||
.. only:: dirhtml
|
||||
|
||||
Screenshot, showing vim, tig and git running in |kitty| with the 'Tall' layout
|
||||
.. raw:: html
|
||||
|
||||
<video controls width="640" height="360">
|
||||
<source src="https://download.calibre-ebook.com/videos/kitty.mp4" type="video/mp4">
|
||||
<source src="https://download.calibre-ebook.com/videos/kitty.webm" type="video/webm">
|
||||
</video>
|
||||
|
||||
.. rst-class:: caption caption-text
|
||||
|
||||
Watch kitty in action!
|
||||
|
||||
|
||||
To get started see :doc:`quickstart`.
|
||||
|
||||
@@ -20,10 +20,16 @@ import tempfile
|
||||
py3 = sys.version_info[0] > 2
|
||||
is64bit = platform.architecture()[0] == '64bit'
|
||||
is_macos = 'darwin' in sys.platform.lower()
|
||||
is_linux_arm = is_linux_arm64 = False
|
||||
if is_macos:
|
||||
mac_ver = tuple(map(int, platform.mac_ver()[0].split('.')))
|
||||
if mac_ver[:2] < (10, 12):
|
||||
raise SystemExit('Your version of macOS is too old, at least 10.12 is required')
|
||||
else:
|
||||
machine = (os.uname()[4] or '').lower()
|
||||
if machine.startswith('arm') or machine.startswith('aarch64'):
|
||||
is_linux_arm = True
|
||||
is_linux_arm64 = machine.startswith('arm64') or machine.startswith('aarch64')
|
||||
|
||||
try:
|
||||
__file__
|
||||
@@ -73,9 +79,11 @@ class Reporter: # {{{
|
||||
# }}}
|
||||
|
||||
|
||||
def get_latest_release_data():
|
||||
def get_release_data(relname='latest'):
|
||||
print('Checking for latest release on GitHub...')
|
||||
req = urllib.Request('https://api.github.com/repos/kovidgoyal/kitty/releases/latest', headers={'Accept': 'application/vnd.github.v3+json'})
|
||||
req = urllib.Request(
|
||||
'https://api.github.com/repos/kovidgoyal/kitty/releases/' + relname,
|
||||
headers={'Accept': 'application/vnd.github.v3+json'})
|
||||
try:
|
||||
res = urllib.urlopen(req).read().decode('utf-8')
|
||||
except Exception as err:
|
||||
@@ -90,7 +98,8 @@ def get_latest_release_data():
|
||||
else:
|
||||
if name.endswith('.txz'):
|
||||
if is64bit:
|
||||
if name.endswith('-x86_64.txz'):
|
||||
q = '-arm64.txz' if is_linux_arm64 else '-x86_64.txz'
|
||||
if name.endswith(q):
|
||||
return html_url + '/' + name, asset['size']
|
||||
else:
|
||||
if name.endswith('-i686.txz'):
|
||||
@@ -184,19 +193,22 @@ def main(dest=None, launch=True, installer=None):
|
||||
dest = '/Applications'
|
||||
else:
|
||||
dest = os.path.expanduser('~/.local')
|
||||
machine = os.uname()[4]
|
||||
if machine and machine.lower().startswith('arm'):
|
||||
if is_linux_arm and not is_linux_arm64:
|
||||
raise SystemExit(
|
||||
'You are running on an ARM system. The kitty binaries are only'
|
||||
' available for x86 systems. You will have to build from'
|
||||
'You are running on a 32-bit ARM system. The kitty binaries are only'
|
||||
' available for 64 bit ARM systems. You will have to build from'
|
||||
' source.')
|
||||
if not installer:
|
||||
url, size = get_latest_release_data()
|
||||
url, size = get_release_data()
|
||||
installer = download_installer(url, size)
|
||||
else:
|
||||
installer = os.path.abspath(installer)
|
||||
if not os.access(installer, os.R_OK):
|
||||
raise SystemExit('Could not read from: {}'.format(installer))
|
||||
if installer == 'nightly':
|
||||
url, size = get_release_data('tags/nightly')
|
||||
installer = download_installer(url, size)
|
||||
else:
|
||||
installer = os.path.abspath(installer)
|
||||
if not os.access(installer, os.R_OK):
|
||||
raise SystemExit('Could not read from: {}'.format(installer))
|
||||
if is_macos:
|
||||
macos_install(installer, dest=dest, launch=launch)
|
||||
else:
|
||||
@@ -227,7 +239,7 @@ def script_launch():
|
||||
main(**kwargs)
|
||||
|
||||
|
||||
def update_intaller_wrapper():
|
||||
def update_installer_wrapper():
|
||||
# To run: python3 -c "import runpy; runpy.run_path('installer.py', run_name='update_wrapper')" installer.sh
|
||||
with open(__file__, 'rb') as f:
|
||||
src = f.read().decode('utf-8')
|
||||
@@ -244,6 +256,6 @@ def update_intaller_wrapper():
|
||||
if __name__ == '__main__' and from_file:
|
||||
main()
|
||||
elif __name__ == 'update_wrapper':
|
||||
update_intaller_wrapper()
|
||||
update_installer_wrapper()
|
||||
elif __name__ == 'script_launch':
|
||||
script_launch()
|
||||
|
||||
@@ -25,6 +25,268 @@ echo Using python executable: $python
|
||||
$python -c "import sys; script_launch=lambda:sys.exit('Download of installer failed!'); exec(sys.stdin.read()); script_launch()" "$@" <<'INSTALLER_HEREDOC'
|
||||
# {{{
|
||||
# HEREDOC_START
|
||||
#!/usr/bin/env python3
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
from __future__ import (
|
||||
absolute_import, division, print_function, unicode_literals
|
||||
)
|
||||
|
||||
import atexit
|
||||
import json
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import shlex
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
py3 = sys.version_info[0] > 2
|
||||
is64bit = platform.architecture()[0] == '64bit'
|
||||
is_macos = 'darwin' in sys.platform.lower()
|
||||
is_linux_arm = is_linux_arm64 = False
|
||||
if is_macos:
|
||||
mac_ver = tuple(map(int, platform.mac_ver()[0].split('.')))
|
||||
if mac_ver[:2] < (10, 12):
|
||||
raise SystemExit('Your version of macOS is too old, at least 10.12 is required')
|
||||
else:
|
||||
machine = (os.uname()[4] or '').lower()
|
||||
if machine.startswith('arm') or machine.startswith('aarch64'):
|
||||
is_linux_arm = True
|
||||
is_linux_arm64 = machine.startswith('arm64') or machine.startswith('aarch64')
|
||||
|
||||
try:
|
||||
__file__
|
||||
from_file = True
|
||||
except NameError:
|
||||
from_file = False
|
||||
|
||||
if py3:
|
||||
unicode = str
|
||||
raw_input = input
|
||||
import urllib.request as urllib
|
||||
|
||||
def encode_for_subprocess(x):
|
||||
return x
|
||||
else:
|
||||
from future_builtins import map
|
||||
import urllib2 as urllib
|
||||
|
||||
def encode_for_subprocess(x):
|
||||
if isinstance(x, unicode):
|
||||
x = x.encode('utf-8')
|
||||
return x
|
||||
|
||||
|
||||
def run(*args):
|
||||
if len(args) == 1:
|
||||
args = shlex.split(args[0])
|
||||
args = list(map(encode_for_subprocess, args))
|
||||
ret = subprocess.Popen(args).wait()
|
||||
if ret != 0:
|
||||
raise SystemExit(ret)
|
||||
|
||||
|
||||
class Reporter: # {{{
|
||||
|
||||
def __init__(self, fname):
|
||||
self.fname = fname
|
||||
self.last_percent = 0
|
||||
|
||||
def __call__(self, blocks, block_size, total_size):
|
||||
percent = (blocks*block_size)/float(total_size)
|
||||
report = '\rDownloaded {:.1%} '.format(percent)
|
||||
if percent - self.last_percent > 0.05:
|
||||
self.last_percent = percent
|
||||
print(report, end='')
|
||||
sys.stdout.flush()
|
||||
# }}}
|
||||
|
||||
|
||||
def get_release_data(relname='latest'):
|
||||
print('Checking for latest release on GitHub...')
|
||||
req = urllib.Request(
|
||||
'https://api.github.com/repos/kovidgoyal/kitty/releases/' + relname,
|
||||
headers={'Accept': 'application/vnd.github.v3+json'})
|
||||
try:
|
||||
res = urllib.urlopen(req).read().decode('utf-8')
|
||||
except Exception as err:
|
||||
raise SystemExit('Failed to contact {} with error: {}'.format(req.get_full_url(), err))
|
||||
data = json.loads(res)
|
||||
html_url = data['html_url'].replace('/tag/', '/download/').rstrip('/')
|
||||
for asset in data.get('assets', ()):
|
||||
name = asset['name']
|
||||
if is_macos:
|
||||
if name.endswith('.dmg'):
|
||||
return html_url + '/' + name, asset['size']
|
||||
else:
|
||||
if name.endswith('.txz'):
|
||||
if is64bit:
|
||||
q = '-arm64.txz' if is_linux_arm64 else '-x86_64.txz'
|
||||
if name.endswith(q):
|
||||
return html_url + '/' + name, asset['size']
|
||||
else:
|
||||
if name.endswith('-i686.txz'):
|
||||
return html_url + '/' + name, asset['size']
|
||||
raise SystemExit('Failed to find the installer package on github')
|
||||
|
||||
|
||||
def do_download(url, size, dest):
|
||||
print('Will download and install', os.path.basename(dest))
|
||||
reporter = Reporter(os.path.basename(dest))
|
||||
|
||||
# Get content length and check if range is supported
|
||||
rq = urllib.urlopen(url)
|
||||
headers = rq.info()
|
||||
sent_size = int(headers['content-length'])
|
||||
if sent_size != size:
|
||||
raise SystemExit('Failed to download from {} Content-Length ({}) != {}'.format(url, sent_size, size))
|
||||
with open(dest, 'wb') as f:
|
||||
while f.tell() < size:
|
||||
raw = rq.read(8192)
|
||||
if not raw:
|
||||
break
|
||||
f.write(raw)
|
||||
reporter(f.tell(), 1, size)
|
||||
rq.close()
|
||||
if os.path.getsize(dest) < size:
|
||||
raise SystemExit('Download failed, try again later')
|
||||
print('\rDownloaded {} bytes'.format(os.path.getsize(dest)))
|
||||
|
||||
|
||||
def clean_cache(cache, fname):
|
||||
for x in os.listdir(cache):
|
||||
if fname not in x:
|
||||
os.remove(os.path.join(cache, x))
|
||||
|
||||
|
||||
def download_installer(url, size):
|
||||
fname = url.rpartition('/')[-1]
|
||||
tdir = tempfile.gettempdir()
|
||||
cache = os.path.join(tdir, 'kitty-installer-cache')
|
||||
if not os.path.exists(cache):
|
||||
os.makedirs(cache)
|
||||
clean_cache(cache, fname)
|
||||
dest = os.path.join(cache, fname)
|
||||
if os.path.exists(dest) and os.path.getsize(dest) == size:
|
||||
print('Using previously downloaded', fname)
|
||||
return dest
|
||||
if os.path.exists(dest):
|
||||
os.remove(dest)
|
||||
do_download(url, size, dest)
|
||||
return dest
|
||||
|
||||
|
||||
def macos_install(dmg, dest='/Applications', launch=True):
|
||||
mp = tempfile.mkdtemp()
|
||||
atexit.register(shutil.rmtree, mp)
|
||||
run('hdiutil', 'attach', dmg, '-mountpoint', mp)
|
||||
try:
|
||||
os.chdir(mp)
|
||||
app = 'kitty.app'
|
||||
d = os.path.join(dest, app)
|
||||
if os.path.exists(d):
|
||||
shutil.rmtree(d)
|
||||
dest = os.path.join(dest, app)
|
||||
run('ditto', '-v', app, dest)
|
||||
print('Successfully installed kitty into', dest)
|
||||
if launch:
|
||||
run('open', dest)
|
||||
finally:
|
||||
os.chdir('/')
|
||||
run('hdiutil', 'detach', mp)
|
||||
|
||||
|
||||
def linux_install(installer, dest=os.path.expanduser('~/.local'), launch=True):
|
||||
dest = os.path.join(dest, 'kitty.app')
|
||||
if os.path.exists(dest):
|
||||
shutil.rmtree(dest)
|
||||
os.makedirs(dest)
|
||||
print('Extracting tarball...')
|
||||
run('tar', '-C', dest, '-xJof', installer)
|
||||
print('kitty successfully installed to', dest)
|
||||
kitty = os.path.join(dest, 'bin', 'kitty')
|
||||
print('Use', kitty, 'to run kitty')
|
||||
if launch:
|
||||
run(kitty, '--detach')
|
||||
|
||||
|
||||
def main(dest=None, launch=True, installer=None):
|
||||
if not dest:
|
||||
if is_macos:
|
||||
dest = '/Applications'
|
||||
else:
|
||||
dest = os.path.expanduser('~/.local')
|
||||
if is_linux_arm and not is_linux_arm64:
|
||||
raise SystemExit(
|
||||
'You are running on a 32-bit ARM system. The kitty binaries are only'
|
||||
' available for 64 bit ARM systems. You will have to build from'
|
||||
' source.')
|
||||
if not installer:
|
||||
url, size = get_release_data()
|
||||
installer = download_installer(url, size)
|
||||
else:
|
||||
if installer == 'nightly':
|
||||
url, size = get_release_data('tags/nightly')
|
||||
installer = download_installer(url, size)
|
||||
else:
|
||||
installer = os.path.abspath(installer)
|
||||
if not os.access(installer, os.R_OK):
|
||||
raise SystemExit('Could not read from: {}'.format(installer))
|
||||
if is_macos:
|
||||
macos_install(installer, dest=dest, launch=launch)
|
||||
else:
|
||||
linux_install(installer, dest=dest, launch=launch)
|
||||
|
||||
|
||||
def script_launch():
|
||||
# To test: python3 -c "import runpy; runpy.run_path('installer.py', run_name='script_launch')"
|
||||
def path(x):
|
||||
return os.path.expandvars(os.path.expanduser(x))
|
||||
|
||||
def to_bool(x):
|
||||
return x.lower() in {'y', 'yes', '1', 'true'}
|
||||
|
||||
type_map = {x: path for x in 'dest installer'.split()}
|
||||
type_map['launch'] = to_bool
|
||||
kwargs = {}
|
||||
|
||||
for arg in sys.argv[1:]:
|
||||
if arg:
|
||||
m = re.match('([a-z_]+)=(.+)', arg)
|
||||
if m is None:
|
||||
raise SystemExit('Unrecognized command line argument: ' + arg)
|
||||
k = m.group(1)
|
||||
if k not in type_map:
|
||||
raise SystemExit('Unrecognized command line argument: ' + arg)
|
||||
kwargs[k] = type_map[k](m.group(2))
|
||||
main(**kwargs)
|
||||
|
||||
|
||||
def update_installer_wrapper():
|
||||
# To run: python3 -c "import runpy; runpy.run_path('installer.py', run_name='update_wrapper')" installer.sh
|
||||
with open(__file__, 'rb') as f:
|
||||
src = f.read().decode('utf-8')
|
||||
wrapper = sys.argv[-1]
|
||||
with open(wrapper, 'r+b') as f:
|
||||
raw = f.read().decode('utf-8')
|
||||
nraw = re.sub(r'^# HEREDOC_START.+^# HEREDOC_END', lambda m: '# HEREDOC_START\n{}\n# HEREDOC_END'.format(src), raw, flags=re.MULTILINE | re.DOTALL)
|
||||
if 'update_intaller_wrapper()' not in nraw:
|
||||
raise SystemExit('regex substitute of HEREDOC failed')
|
||||
f.seek(0), f.truncate()
|
||||
f.write(nraw.encode('utf-8'))
|
||||
|
||||
|
||||
if __name__ == '__main__' and from_file:
|
||||
main()
|
||||
elif __name__ == 'update_wrapper':
|
||||
update_installer_wrapper()
|
||||
elif __name__ == 'script_launch':
|
||||
script_launch()
|
||||
|
||||
# HEREDOC_END
|
||||
# }}}
|
||||
INSTALLER_HEREDOC
|
||||
|
||||
@@ -32,6 +32,13 @@ You can see this protocol with all enhancements in action by running::
|
||||
|
||||
inside the kitty terminal to report key events.
|
||||
|
||||
In addition to kitty, this protocol is also implemented in:
|
||||
|
||||
* The `foot terminal <https://codeberg.org/dnkl/foot/issues/319>`__
|
||||
* The `notcurses library
|
||||
<https://github.com/dankamongmen/notcurses/issues/2131>`__
|
||||
* The `kakoune text editor <https://github.com/mawww/kakoune/issues/4103>`__
|
||||
|
||||
.. versionadded:: 0.20.0
|
||||
|
||||
Quickstart
|
||||
@@ -66,10 +73,11 @@ key, such as ``97`` for the :kbd:`a` key, or one of the numbers from the
|
||||
modifiers pressed for the key event. The encoding is described in the
|
||||
:ref:`modifiers` section.
|
||||
|
||||
The second form is used for a few functional keys, such as the :kbd:`Home, End,
|
||||
Arrow keys and F1-F4`, they are enumerated in the :ref:`functional` table below.
|
||||
Note that if no modifiers are present the parameters are omitted entirely
|
||||
giving an escape code of the form ``CSI [ABCDEFHPQRS]``.
|
||||
The second form is used for a few functional keys, such as the :kbd:`Home`,
|
||||
:kbd:`End`, :kbd:`Arrow` keys and :kbd:`F1` ... :kbd:`F4`, they are enumerated in
|
||||
the :ref:`functional` table below. Note that if no modifiers are present the
|
||||
parameters are omitted entirely giving an escape code of the form ``CSI
|
||||
[ABCDEFHPQRS]``.
|
||||
|
||||
If you want support for more advanced features such as repeat and release
|
||||
events, alternate keys for shortcut matching et cetera, these can be turned on
|
||||
@@ -142,11 +150,13 @@ sub-field for the shifted key, like this::
|
||||
Modifiers
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
This protocol supports six modifier keys, :kbd:`shift, alt, ctrl, super, hyper
|
||||
and meta` as well as :kbd:`num_lock and caps_lock`. Here :kbd:`super` is either
|
||||
the *Windows/Linux* key or the *Cmd* key on mac keyboards. :kbd:`hyper` and
|
||||
:kbd:`meta` are typically present only on X11 based systems with special XKB
|
||||
rules. Modifiers are encoded as a bit field with::
|
||||
This protocol supports six modifier keys, :kbd:`shift`, :kbd:`alt`,
|
||||
:kbd:`ctrl`, :kbd:`super`, :kbd:`hyper`, :kbd:`meta`, :kbd:`num_lock` and
|
||||
:kbd:`caps_lock`. Here :kbd:`super` is either the *Windows/Linux* key or the
|
||||
:kbd:`command` key on mac keyboards. The :kbd:`alt` key is the :kbd:`option`
|
||||
key on mac keyboards. :kbd:`hyper` and :kbd:`meta` are typically present only
|
||||
on X11/Wayland based systems with special XKB rules. Modifiers are encoded as a
|
||||
bit field with::
|
||||
|
||||
shift 0b1 (1)
|
||||
alt 0b10 (2)
|
||||
@@ -209,9 +219,9 @@ Non-Unicode keys
|
||||
|
||||
There are many keys that don't correspond to letters from human languages, and
|
||||
thus aren't represented in Unicode. Think of functional keys, such as
|
||||
:kbd:`Escape, Play, Pause, F1, Home, etc`. These are encoded using Unicode code
|
||||
points from the Private Use Area (``57344 - 63743``). The mapping of key
|
||||
names to code points for these keys is in the
|
||||
:kbd:`Escape`, :kbd:`Play`, :kbd:`Pause`, :kbd:`F1`, :kbd:`Home`, etc. These
|
||||
are encoded using Unicode code points from the Private Use Area (``57344 -
|
||||
63743``). The mapping of key names to code points for these keys is in the
|
||||
:ref:`Functional key definition table below <functional>`.
|
||||
|
||||
|
||||
@@ -277,11 +287,6 @@ oldest entry from the stack must be evicted.
|
||||
the editor would have to somehow know what the keyboard mode of the main
|
||||
screen is and restore to that mode on exit.
|
||||
|
||||
.. note:: In the interests of interoperation, the XTerm specific sequences
|
||||
`CSI > 4; 1 m` and `CSI > 4; 0 m` are treated as `CSI > 1 u` and `CSI < 1 u`.
|
||||
These codes cause XTerm to use the CSI u encoding for more keys and are therefore
|
||||
treated as similar to the disambiguate progressive enhancement.
|
||||
|
||||
.. _disambiguate:
|
||||
|
||||
Disambiguate escape codes
|
||||
@@ -293,8 +298,8 @@ encodings overlapping with other control codes. For instance, pressing the
|
||||
start of an escape code. Similarly pressing the key :kbd:`alt+[` will generate
|
||||
the bytes used for CSI control codes.
|
||||
|
||||
Turning on this flag will cause the terminal to report the :kbd:`Esc, alt+key,
|
||||
ctrl+key, ctrl+alt+key, shift+alt+key` keys using ``CSI u`` sequences instead
|
||||
Turning on this flag will cause the terminal to report the :kbd:`Esc`, :kbd:`alt+key`,
|
||||
:kbd:`ctrl+key`, :kbd:`ctrl+alt+key`, :kbd:`shift+alt+key` keys using ``CSI u`` sequences instead
|
||||
of legacy ones. Here key is any ASCII key as described in :ref:`legacy_text`.
|
||||
Additionally, all keypad keys will be reported as separate keys with ``CSI u``
|
||||
encoding, using dedicated numbers from the :ref:`table below <functional>`.
|
||||
@@ -309,7 +314,7 @@ This makes it very easy to parse key events in an application. In particular,
|
||||
:kbd:`ctrl+c` will no longer generate the ``SIGINT`` signal, but instead be
|
||||
delivered as a ``CSI u`` escape code. This has the nice side effect of making it
|
||||
much easier to integrate into the application event loop. The only exceptions
|
||||
are the :kbd:`Enter, Tab and Backspace` keys which still generate the same
|
||||
are the :kbd:`Enter`, :kbd:`Tab` and :kbd:`Backspace` keys which still generate the same
|
||||
bytes as in legacy mode this is to allow the user to type and execute commands
|
||||
in the shell such as ``reset`` after a program that sets this mode crashes
|
||||
without clearing it.
|
||||
@@ -349,8 +354,8 @@ only key events are sent. If the text is needed as well, combine with the
|
||||
Report associated text enhancement below.
|
||||
|
||||
Additionally, with this mode, events for pressing modifier keys are reported.
|
||||
Note that *all* keys are reported as escape codes, including :kbd:`Enter, Tab,
|
||||
Backspace` etc.
|
||||
Note that *all* keys are reported as escape codes, including :kbd:`Enter`,
|
||||
:kbd:`Tab`, :kbd:`Backspace` etc.
|
||||
|
||||
.. _report_text:
|
||||
|
||||
@@ -462,10 +467,11 @@ distinguish these, use the :ref:`disambiguate <disambiguate>` flag.
|
||||
Legacy text keys
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
For legacy compatibility, the keys
|
||||
:kbd:`a-z 0-9 \` - = [ ] \ ; ' , . /` with the modifiers
|
||||
:kbd:`shift, alt, ctrl, shift+alt, ctrl+alt` are output using the
|
||||
following algorithm:
|
||||
For legacy compatibility, the keys :kbd:`a`-:kbd:`z` :kbd:`0`-:kbd:`9`
|
||||
:kbd:`\`` :kbd:`-` :kbd:`=` :kbd:`[` :kbd:`]` :kbd:`\\` :kbd:`;` :kbd:`'`
|
||||
:kbd:`,` :kbd:`.` :kbd:`/` with the modifiers :kbd:`shift`, :kbd:`alt`,
|
||||
:kbd:`ctrl`, :kbd:`shift+alt`, :kbd:`ctrl+alt` are output using the following
|
||||
algorithm:
|
||||
|
||||
#. If the :kbd:`alt` key is pressed output the byte for ``ESC (0x1b)``
|
||||
#. If the :kbd:`ctrl` modifier is pressed map the key using the table
|
||||
@@ -637,8 +643,8 @@ specification.
|
||||
* Incorrectly encoding shifted keys when shift modifier is used, for instance,
|
||||
for :kbd:`ctrl+shift+i` is encoded as :kbd:`ctrl+I`.
|
||||
|
||||
* No way to have non-conflicting escape codes for :kbd:`alt+letter,
|
||||
ctrl+letter, ctrl+alt+letter` key presses
|
||||
* No way to have non-conflicting escape codes for :kbd:`alt+letter`,
|
||||
:kbd:`ctrl+letter`, :kbd:`ctrl+alt+letter` key presses
|
||||
|
||||
* No way to specify both shifted and unshifted keys for robust shortcut
|
||||
matching (think matching :kbd:`ctrl+shift+equal` and :kbd:`ctrl+plus`)
|
||||
|
||||
@@ -88,11 +88,41 @@ function, telling kitty what kind of input your kitten would like. For example:
|
||||
|
||||
|
||||
This will send the plain text of the active window to the kitten's
|
||||
:file:`STDIN`. For text with formatting escape codes, use ``ansi``
|
||||
instead. If you want line wrap markers as well, use ``screen-ansi``
|
||||
or just ``screen``. For the scrollback buffer as well, use
|
||||
``history``, ``ansi-history`` or ``screen-history``. To get
|
||||
the currently selected text, use ``selection``.
|
||||
:file:`STDIN`. There are many other types of input you can ask for,
|
||||
described in the table below:
|
||||
|
||||
.. table:: Types of input to kittens
|
||||
:align: left
|
||||
|
||||
=========================== =======================================================================================================
|
||||
Keyword Type of :file:`STDIN` input
|
||||
=========================== =======================================================================================================
|
||||
``text`` Plain text of active window
|
||||
``ansi`` Formatted text of active window
|
||||
``screen`` Plain text of active window with line wrap markers
|
||||
``screen-ansi`` Formatted text of active window with line wrap markers
|
||||
|
||||
``history`` Plain text of active window and its scrollback
|
||||
``ansi-history`` Formatted text of active window and its scrollback
|
||||
``screen-history`` Plain text of active window and its scrollback with line wrap markers
|
||||
``screen-ansi-history`` Formatted text of active window and its scrollback with line wrap markers
|
||||
|
||||
``output`` Plain text of the output from the last run command
|
||||
``output-screen`` Plain text of the output from the last run command with wrap markers
|
||||
``output-ansi`` Formatted text of the output from the last run command
|
||||
``output-screen-ansi`` Formatted text of the output from the last run command with wrap markers
|
||||
|
||||
``selection`` The text currently selected with the mouse
|
||||
=========================== =======================================================================================================
|
||||
|
||||
In addition to ``output``, that gets the output of the last run command,
|
||||
``last_visited_output`` gives the output of the command last jumped to
|
||||
and ``first_output`` gives the output of the first command currently on screen.
|
||||
These can also be combined with ``screen`` and ``ansi`` for formatting.
|
||||
|
||||
.. note::
|
||||
For the types based on the output of a command,
|
||||
:ref:`shell_integration` is required.
|
||||
|
||||
|
||||
Using kittens to script kitty, without any terminal UI
|
||||
|
||||
@@ -35,7 +35,7 @@ Simply :ref:`install kitty <quickstart>`. You also need
|
||||
to have either the `git <https://git-scm.com/>`_ program or the ``diff`` program
|
||||
installed. Additionally, for syntax highlighting to work,
|
||||
`pygments <https://pygments.org/>`_ must be installed (note that pygments is
|
||||
included in the macOS kitty app).
|
||||
included in the official kitty binary builds).
|
||||
|
||||
|
||||
Usage
|
||||
@@ -67,14 +67,14 @@ Keyboard controls
|
||||
========================= ===========================
|
||||
Action Shortcut
|
||||
========================= ===========================
|
||||
Quit :kbd:`q, Ctrl+c, Esc`
|
||||
Scroll line up :kbd:`k, up`
|
||||
Scroll line down :kbd:`j, down`
|
||||
Quit :kbd:`q`, :kbd:`ctrl+c`, :kbd:`Esc`
|
||||
Scroll line up :kbd:`k`, :kbd:`Up`
|
||||
Scroll line down :kbd:`j`, :kbd:`Down`
|
||||
Scroll page up :kbd:`PgUp`
|
||||
Scroll page down :kbd:`PgDn`
|
||||
Scroll to top :kbd:`Home`
|
||||
Scroll to bottom :kbd:`End`
|
||||
Scroll to next page :kbd:`Space, PgDn`
|
||||
Scroll to next page :kbd:`Space`, :kbd:`PgDn`
|
||||
Scroll to previous page :kbd:`PgUp`
|
||||
Scroll to next change :kbd:`n`
|
||||
Scroll to previous change :kbd:`p`
|
||||
@@ -85,8 +85,8 @@ Restore default context :kbd:`=`
|
||||
Search forwards :kbd:`/`
|
||||
Search backwards :kbd:`?`
|
||||
Clear search :kbd:`Esc`
|
||||
Scroll to next match :kbd:`>, .`
|
||||
Scroll to previous match :kbd:`<, ,`
|
||||
Scroll to next match :kbd:`>`, :kbd:`.`
|
||||
Scroll to previous match :kbd:`<`, :kbd:`,`
|
||||
========================= ===========================
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ taken for different types of URLs <../open_actions>`.
|
||||
The hints kitten is very powerful to see more detailed help on its various
|
||||
options and modes of operation, see below. You can use these options to
|
||||
create mappings in :file:`kitty.conf` to select various different text
|
||||
snippets. See :sc:`insert_selected_path` for examples.
|
||||
snippets. See :sc:`insert_selected_path <insert_selected_path>` for examples.
|
||||
|
||||
|
||||
Completely customizing the matching and actions of the kitten
|
||||
@@ -92,10 +92,9 @@ look it up in the Google dictionary.
|
||||
|
||||
.. note::
|
||||
|
||||
To avoid having to specify the same command line options on ever invocation,
|
||||
you can use the :opt:`kitten_alias` option in :file:`kitty.conf` to create aliases
|
||||
To avoid having to specify the same command line options on every invocation,
|
||||
you can use the :opt:`action_alias` option in :file:`kitty.conf`, creating aliases
|
||||
that have common sets of options. For example::
|
||||
|
||||
kitten_alias myhints hints --alphabet qfjdkslaureitywovmcxzpq1234567890
|
||||
|
||||
Documentation for the full set of options is below.
|
||||
action_alias myhints kitten hints --alphabet qfjdkslaureitywovmcxzpq1234567890
|
||||
map f1 myhints --customize-processing custom-hints.py
|
||||
|
||||
@@ -3,7 +3,7 @@ Hyperlinked grep
|
||||
|
||||
|
||||
This kitten allows you to search your files using `ripgrep
|
||||
<https://www.google.com/search?q=ripgrep>`_ and open the results
|
||||
<https://github.com/BurntSushi/ripgrep>`_ and open the results
|
||||
directly in your favorite editor in the terminal, at the line containing
|
||||
the search result, simply by clicking on the result you want.
|
||||
|
||||
|
||||
@@ -22,12 +22,15 @@ transferred to the remote computer. Note that this happens without needing
|
||||
to install *any* special software on the server, beyond ``ls`` that supports
|
||||
hyperlinks.
|
||||
|
||||
.. seealso:: See the :doc:`transfer` kitten
|
||||
|
||||
.. versionadded:: 0.19.0
|
||||
|
||||
.. note::
|
||||
Nested SSH sessions are not supported. The kitten will always try to copy
|
||||
remote files from the first SSH host. This is because there is no way for
|
||||
|kitty| to detect and follow a nested SSH session robustly.
|
||||
|kitty| to detect and follow a nested SSH session robustly. Use the
|
||||
:doc:`transfer` kitten for such situations.
|
||||
|
||||
.. note::
|
||||
If you have not setup automatic password-less SSH access, then, when
|
||||
|
||||
78
docs/kittens/themes.rst
Normal file
@@ -0,0 +1,78 @@
|
||||
Changing kitty colors
|
||||
========================
|
||||
|
||||
The themes kitten allows you to easily change color themes, from a collection
|
||||
of almost two hundred pre-built themes available at `kitty-themes
|
||||
<https://github.com/kovidgoyal/kitty-themes>`_. To use it, simply run::
|
||||
|
||||
kitty +kitten themes
|
||||
|
||||
|
||||
.. image:: ../screenshots/themes.png
|
||||
:alt: The themes kitten in action
|
||||
:width: 600
|
||||
|
||||
The kitten allows you to pick a theme, with live previews of the colors. You
|
||||
can choose between light and dark themes and search by theme name by just
|
||||
typing a few characters from the name.
|
||||
|
||||
The kitten maintains a list of recently used themes to allow quick switching.
|
||||
|
||||
If you want to restore the colors to default, you can do so by choosing the
|
||||
``Default`` theme.
|
||||
|
||||
.. versionadded:: 0.23.0
|
||||
The themes kitten
|
||||
|
||||
How it works
|
||||
----------------
|
||||
|
||||
A theme in kitty is just a :file:`.conf` file containing kitty settings.
|
||||
When you select a theme, the kitten simply copies the :file:`.conf` file
|
||||
to :file:`~/.config/kitty/current-theme.conf` and adds an include for
|
||||
:file:`current-theme.conf` to :file:`kitty.conf`. It also comments out
|
||||
any existing color settings in :file:`kitty.conf` so they do not interfere.
|
||||
|
||||
Once that's done, the kitten sends kitty a signal to make it reload its config.
|
||||
|
||||
Using your own themes
|
||||
-----------------------
|
||||
|
||||
You can also create your own themes as :file:`.conf` files. Put them in the
|
||||
:file:`themes` sub-directory of the kitty config directory, usually,
|
||||
:file:`~/.config/kitty/themes` and the kitten will automatically add them to
|
||||
the list of themes. You can use this to modify the builtin themes, by giving
|
||||
the conf file the name :file:`Some theme name.conf` to override the builtin
|
||||
theme of that name. Note that after doing so you have to run the kitten and
|
||||
choose that theme once for your changes to be applied.
|
||||
|
||||
|
||||
Contributing new themes
|
||||
-------------------------
|
||||
|
||||
If you wish to contribute a new theme to the kitty theme repository, start by
|
||||
going to the `kitty-themes <https://github.com/kovidgoyal/kitty-themes>`__
|
||||
repository. `Fork it
|
||||
<https://docs.github.com/en/get-started/quickstart/fork-a-repo>`_, and use the
|
||||
file :download:`template.conf
|
||||
<https://github.com/kovidgoyal/kitty-themes/raw/master/template.conf>` as a
|
||||
template when creating your theme. Once you are satisfied with how it looks,
|
||||
`submit a pull request
|
||||
<https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request>`_
|
||||
to have your theme merged into the `kitty-themes
|
||||
<https://github.com/kovidgoyal/kitty-themes>`__ repository, which will make it
|
||||
available in this kitten automatically.
|
||||
|
||||
|
||||
Changing the theme non-interactively
|
||||
---------------------------------------
|
||||
|
||||
You can specify the theme name as an argument when invoking the kitten
|
||||
to have it change to that theme instantly. For example::
|
||||
|
||||
kitty +kitten themes --reload-in=all Dimmed Monokai
|
||||
|
||||
Will change the theme to ``Dimmed Monokai`` in all running kitty
|
||||
instances. See below for more details on non-interactive operation.
|
||||
|
||||
.. include:: ../generated/cli-kitten-themes.rst
|
||||
97
docs/kittens/transfer.rst
Normal file
@@ -0,0 +1,97 @@
|
||||
Transfer files
|
||||
================
|
||||
|
||||
.. _rsync: https://en.wikipedia.org/wiki/Rsync
|
||||
|
||||
.. warning::
|
||||
This kitten is currently experimental, use with care.
|
||||
|
||||
Transfer files to and from remote computers over the ``TTY`` device itself.
|
||||
This means that file transfer works over nested SSH sessions, serial links,
|
||||
etc. Anywhere you have a terminal device, you can transfer files.
|
||||
|
||||
.. image:: ../screenshots/transfer.png
|
||||
:alt: The transfer kitten at work
|
||||
|
||||
This kitten supports transferring entire directory trees, preserving soft and
|
||||
hard links, file permissions, times, etc. It even supports the rsync_
|
||||
protocol to transfer only changes to large files.
|
||||
|
||||
.. seealso:: See the :doc:`remote_file` kitten
|
||||
|
||||
.. note::
|
||||
This kitten (which practically means kitty) must be installed on the other
|
||||
machine as well. If that is not possible you can use the :doc:`remote_file`
|
||||
kitten instead. Or write your own script to use the underlying :doc:`file transfer
|
||||
protocol </file-transfer-protocol>`.
|
||||
|
||||
.. versionadded:: 0.24.0
|
||||
|
||||
|
||||
Basic usage
|
||||
---------------
|
||||
|
||||
In what follows, the *local computer* is the computer running this kitten and
|
||||
the *remote computer* is the computer connected to the other end of the TTY pipe.
|
||||
|
||||
To send a file from the local computer to the remote computer, simply run::
|
||||
|
||||
kitty +kitten transfer /path/to/local/file /path/to/destination/on/remote/computer
|
||||
|
||||
You will be prompted by kitty for confirmation on allowing the transfer, and if
|
||||
you grant permission, the file will be copied.
|
||||
|
||||
Similarly, to get a file from the remote computer to the local computer, use
|
||||
the :option:`kitty +kitten transfer --direction` option::
|
||||
|
||||
kitty +kitten transfer --direction=receive /path/to/remote/file /path/to/destination/on/local/computer
|
||||
|
||||
Multiple files and even directories can be transferred::
|
||||
|
||||
kitty +kitten transfer file1 dir1 destination/
|
||||
|
||||
Here :file:`file1` will be copied inside :file:`destination` and :file:`dir1`
|
||||
will be recursively copied into :file:`destination`. Note the trailing slash on
|
||||
:file:`destination`. This tells kitty the destination is a directory. While not
|
||||
strictly necessary (kitty will infer the need for a destination directory from
|
||||
the fact that you are copying multiple things) it is good practice to always
|
||||
use a trailing slash when the destination is supposed to be a directory.
|
||||
|
||||
Also, when transferring multiple files/directories it is a good idea to
|
||||
use the :option:`kitty +kitten transfer --confirm-paths` option which will give
|
||||
you an opportunity to review and confirm the files that will be touched.
|
||||
|
||||
|
||||
Avoiding the confirmation prompt
|
||||
------------------------------------
|
||||
|
||||
Normally, when you start a file transfer kitty will prompt you for
|
||||
confirmation. This is to ensure that hostile programs running on a remote
|
||||
machine cannot read/write files on your computer without your permission.
|
||||
If the remote machine is trusted and the connection between your computer
|
||||
and the remote machine is secure, then you can disable the confirmation prompt
|
||||
by:
|
||||
|
||||
#. Setting the :opt:`file_transfer_confirmation_bypass` option to some
|
||||
password.
|
||||
|
||||
#. When invoking the kitten use the :option:`kitty +kitten transfer --permissions-bypass`
|
||||
to supply the password you set in step one.
|
||||
|
||||
.. warning:: Using a password to bypass confirmation means any software running
|
||||
on the remote machine could potentially learn that password and use it to
|
||||
gain full access to your computer. Also anyone that can intercept the data
|
||||
stream between your computer and the remote machine can also learn this
|
||||
password. So use it only with secure connections to trusted computers.
|
||||
|
||||
|
||||
Delta transfers
|
||||
-----------------------------------
|
||||
|
||||
This kitten has the ability to use the rsync_ protocol to only transfer the
|
||||
differences between files. To turn it on use the :option:`kitty +kitten
|
||||
transfer --transmit-deltas` option. Note that this will actually be slower when
|
||||
transferring small files because of round trip overhead, so use with care.
|
||||
|
||||
|
||||
.. include:: ../generated/cli-kitten-transfer.rst
|
||||
@@ -23,9 +23,9 @@ the arrow keys/tab to select the character from the displayed matches. You can
|
||||
also type a space followed by a period and the index for the match if you don't
|
||||
like to use arrow keys.
|
||||
|
||||
You can switch between modes using either the function keys or by pressing
|
||||
:kbd:`Ctrl+[` and :kbd:`Ctrl+]` or by pressing :kbd:`Ctrl+Tab` and
|
||||
:kbd:`Ctrl+Shift+Tab`.
|
||||
You can switch between modes using either the keys :kbd:`F1` ... :kbd:`F4` or
|
||||
:kbd:`Ctrl+1` ... :kbd:`Ctrl+4` or by pressing :kbd:`Ctrl+[` and :kbd:`Ctrl+]`
|
||||
or by pressing :kbd:`Ctrl+Tab` and :kbd:`Ctrl+Shift+Tab`.
|
||||
|
||||
|
||||
.. include:: ../generated/cli-kitten-unicode_input.rst
|
||||
@@ -9,10 +9,12 @@ Extend with kittens
|
||||
|
||||
kittens/icat
|
||||
kittens/diff
|
||||
kittens/unicode-input
|
||||
kittens/unicode_input
|
||||
kittens/themes
|
||||
kittens/hints
|
||||
kittens/remote_file
|
||||
kittens/hyperlinked_grep
|
||||
kittens/transfer
|
||||
kittens/custom
|
||||
kittens/*
|
||||
|
||||
@@ -30,7 +32,7 @@ Some prominent kittens:
|
||||
images
|
||||
|
||||
|
||||
:doc:`Unicode Input <kittens/unicode-input>`
|
||||
:doc:`Unicode Input <kittens/unicode_input>`
|
||||
Easily input arbitrary unicode characters in |kitty| by name or hex code.
|
||||
|
||||
|
||||
@@ -44,6 +46,11 @@ Some prominent kittens:
|
||||
the filename.
|
||||
|
||||
|
||||
:doc:`Transfer files <kittens/transfer>`
|
||||
Transfer files and directories seamlessly and easily from remote machines over your existing
|
||||
SSH sessions with a simple command.
|
||||
|
||||
|
||||
:doc:`Hyperlinked grep <kittens/hyperlinked_grep>`
|
||||
Search your files using `ripgrep <https://github.com/BurntSushi/ripgrep>`_
|
||||
and open the results directly in your favorite editor in the terminal,
|
||||
|
||||
@@ -38,6 +38,18 @@ To pass the contents of the current screen and scrollback to the started process
|
||||
|
||||
There are many more powerful options, refer to the complete list below.
|
||||
|
||||
.. note::
|
||||
To avoid duplicating launch actions with frequently used parameters, you can
|
||||
use :opt:`action_alias` to define launch action aliases. For example::
|
||||
|
||||
action_alias launch_tab launch --cwd=current --type=tab
|
||||
map f1 launch_tab vim
|
||||
map f2 launch_tab emacs
|
||||
|
||||
The :kbd:`F1` key will now open vim in a new tab with the current windows
|
||||
working directory
|
||||
|
||||
|
||||
The piping environment
|
||||
--------------------------
|
||||
|
||||
@@ -89,6 +101,8 @@ For example::
|
||||
map f1 launch my-program @active-kitty-window-id
|
||||
|
||||
|
||||
.. _watchers:
|
||||
|
||||
Watching launched windows
|
||||
---------------------------
|
||||
|
||||
@@ -103,7 +117,7 @@ functions for the events you are interested in, for example:
|
||||
# Here data will contain old_geometry and new_geometry
|
||||
|
||||
def on_focus_change(boss, window, data):
|
||||
# Here data kill contain focused
|
||||
# Here data will contain focused
|
||||
|
||||
def on_close(boss, window, data):
|
||||
# called when window is closed, typically when the program running in
|
||||
@@ -112,7 +126,7 @@ functions for the events you are interested in, for example:
|
||||
|
||||
Every callback is passed a reference to the global ``Boss`` object as well as
|
||||
the ``Window`` object the action is occurring on. The ``data`` object is
|
||||
mapping that contains event dependent data. Some useful methods and attributes
|
||||
a dict that contains event dependent data. Some useful methods and attributes
|
||||
for the ``Window`` object are: ``as_text(as_ans=False, add_history=False,
|
||||
add_wrap_markers=False, alternate_screen=False)`` with which you can get the
|
||||
contents of the window and its scrollback buffer. Similarly,
|
||||
@@ -130,6 +144,7 @@ this **may not** be the value of ``PATH`` inside a shell, as shell startup scrip
|
||||
often change the value of this variable. If it is not found there, then a
|
||||
system specific list of default paths is searched. If it is still not found,
|
||||
then your shell is run and the value of ``PATH`` inside the shell is used.
|
||||
See :opt:`exe_search_path` for details and how to control this.
|
||||
|
||||
Syntax reference
|
||||
------------------
|
||||
|
||||
@@ -145,11 +145,14 @@ define a few extra keybindings in :file:`kitty.conf`::
|
||||
map ctrl+down neighboring_window down
|
||||
|
||||
Now you can create horizontal and vertical splits by using :kbd:`F5` and
|
||||
:kbd:`F6`. You can move them around using :kbd:`shift+arrow keys`
|
||||
and you can move focus to neighboring windows using :kbd:`ctrl+arrow keys`.
|
||||
:kbd:`F6`. You can move them around using :kbd:`shift+arrow` keys
|
||||
and you can move focus to neighboring windows using :kbd:`ctrl+arrow` keys.
|
||||
You can switch an existing split from horizontal to vertical and vice versa
|
||||
using :kbd:`F7`. Finally, windows can be resized using :ref:`window_resizing`.
|
||||
|
||||
Note that you can swap the windows in a split using the ``rotate`` action with
|
||||
an argument of ``180`` and rotate and swap with an argument of ``270``.
|
||||
|
||||
This layout takes one option, ``split_axis`` that controls whether new windows
|
||||
are placed into vertical or horizontal splits, by default::
|
||||
|
||||
|
||||
@@ -58,6 +58,12 @@ some special variables, documented below:
|
||||
``FRAGMENT``
|
||||
The fragment (unquoted), if any of the URL or the empty string.
|
||||
|
||||
|
||||
.. note::
|
||||
You can use the :opt:`action_alias` option just as in kitty.conf to
|
||||
define aliases for frequently used actions.
|
||||
|
||||
|
||||
.. _matching_criteria:
|
||||
|
||||
Matching criteria
|
||||
|
||||
@@ -79,7 +79,7 @@ Extending kitty
|
||||
kitty has a powerful framework for scripting. You can create small terminal
|
||||
programs called :doc:`kittens <kittens_intro>`. These can used to add features
|
||||
to kitty, for example, :doc:`editing remote files <kittens/remote_file>` or
|
||||
:doc:`inputting unicode characters <kittens/unicode-input>`. They can also be
|
||||
:doc:`inputting unicode characters <kittens/unicode_input>`. They can also be
|
||||
used to create programs that leverage kitty's powerful features, for example,
|
||||
:doc:`viewing images <kittens/icat>` or :doc:`diffing files with images
|
||||
<kittens/diff>`.
|
||||
@@ -116,7 +116,7 @@ endless. See the :doc:`tutorial <remote-control>` to get started.
|
||||
Startup Sessions
|
||||
------------------
|
||||
|
||||
You can control the :term:`tabs <tab>`, `:term:`kitty window <window>` layout,
|
||||
You can control the :term:`tabs <tab>`, :term:`kitty window <window>` layout,
|
||||
working directory, startup programs,
|
||||
etc. by creating a "session" file and using the :option:`kitty --session`
|
||||
command line flag or the :opt:`startup_session` option in :file:`kitty.conf`.
|
||||
@@ -191,8 +191,10 @@ Mouse features
|
||||
platforms with a primary clipboard).
|
||||
* You can middle click to paste from the primary clipboard (on platforms
|
||||
with a primary clipboard).
|
||||
* You can right click while holding :kbd:`ctrl+shift` to open the output
|
||||
of the clicked on command in a pager (requires :ref:`shell_integration`)
|
||||
* You can select text with kitty even when a terminal program has grabbed
|
||||
the mouse by holding down the :kbd:`shift` key.
|
||||
the mouse by holding down the :kbd:`shift` key
|
||||
|
||||
All these actions can be customized in :file:`kitty.conf` as described
|
||||
:ref:`here <conf-kitty-mouse.mousemap>`.
|
||||
@@ -242,15 +244,31 @@ for example::
|
||||
map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting less +G -R
|
||||
|
||||
Would open the scrollback buffer in a new :term:`window` when you press the :kbd:`F1`
|
||||
key. See :sc:`show_scrollback` for details.
|
||||
key. See :sc:`show_scrollback <show_scrollback>` for details.
|
||||
|
||||
If you want to use it with an editor such as vim to get more powerful features,
|
||||
you can see tips for doing so, in
|
||||
`this thread <https://github.com/kovidgoyal/kitty/issues/719>`_.
|
||||
|
||||
If you wish to store very large amounts of scrollback to view using the piping or
|
||||
:sc:`show_scrollback` features, you can use the :opt:`scrollback_pager_history_size`
|
||||
option.
|
||||
:sc:`show_scrollback <show_scrollback>` features, you can use the
|
||||
:opt:`scrollback_pager_history_size` option.
|
||||
|
||||
|
||||
Integration with shells
|
||||
---------------------------------
|
||||
|
||||
kitty has the ability to integrate closely within common shells, such as `zsh
|
||||
<https://www.zsh.org/>`_, `fish <https://fishshell.com>`_ and `bash
|
||||
<https://www.gnu.org/software/bash/>`_ to enable features such as jumping to
|
||||
previous prompts in the scrollback, viewing the output of the last command in
|
||||
:program:`less`, using the mouse to move the cursor while editing prompts, etc.
|
||||
See :doc:`shell-integration` for details.
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
shell-integration
|
||||
|
||||
.. _cpbuf:
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ please do so by opening issues in the `GitHub
|
||||
underlines
|
||||
graphics-protocol
|
||||
keyboard-protocol
|
||||
file-transfer-protocol
|
||||
desktop-notifications
|
||||
unscroll
|
||||
color-stack
|
||||
|
||||
|
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 118 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 958 KiB |
BIN
docs/screenshots/select-window.png
Normal file
|
After Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 40 KiB |
BIN
docs/screenshots/themes.png
Normal file
|
After Width: | Height: | Size: 110 KiB |
BIN
docs/screenshots/transfer.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 76 KiB |
BIN
docs/screenshots/window-logo.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
265
docs/shell-integration.rst
Normal file
@@ -0,0 +1,265 @@
|
||||
.. _shell_integration:
|
||||
|
||||
Shell integration
|
||||
-------------------
|
||||
|
||||
kitty has the ability to integrate closely within common shells, such as `zsh
|
||||
<https://www.zsh.org/>`_, `fish <https://fishshell.com>`_ and `bash
|
||||
<https://www.gnu.org/software/bash/>`_ to enable features such as jumping to
|
||||
previous prompts in the scrollback, viewing the output of the last command in
|
||||
:program:`less`, using the mouse to move the cursor while editing prompts, etc.
|
||||
|
||||
.. versionadded:: 0.24.0
|
||||
|
||||
Features
|
||||
-------------
|
||||
|
||||
* Open the output of the last command in a pager such as :program:`less`
|
||||
(:sc:`show_last_command_output`)
|
||||
|
||||
* Jump to the previous/next prompt in the scrollback
|
||||
(:sc:`scroll_to_previous_prompt` / :sc:`scroll_to_next_prompt`)
|
||||
|
||||
* Click with the mouse anywhere in the current command to move the cursor there
|
||||
|
||||
* Hold :kbd:`ctrl+shift` and right-click on any command output in the scrollback
|
||||
to view it in a pager
|
||||
|
||||
* The current working directory or the command being executed are automatically
|
||||
displayed in the kitty window titlebar/tab title.
|
||||
|
||||
* The text cursor is changed to a bar when editing commands at the shell prompt
|
||||
|
||||
* Glitch free window resizing even with complex prompts. Achieved by erasing
|
||||
the prompt on resize and allowing the shell to redraw it cleanly.
|
||||
|
||||
* Sophisticated completion for the :program:`kitty` command in the shell.
|
||||
|
||||
* When confirming a quit command if a window is sitting at a shell prompt,
|
||||
it is optionally, not counted (see :opt:`confirm_os_window_close`)
|
||||
|
||||
|
||||
Configuration
|
||||
---------------
|
||||
|
||||
Shell integration is controlled by the :opt:`shell_integration` option. By
|
||||
default, all shell integration is enabled. Individual features can be turned
|
||||
off or it can be disabled entirely as well. The :opt:`shell_integration` option
|
||||
takes a space separated list of keywords:
|
||||
|
||||
disabled
|
||||
Turn off all shell integration
|
||||
|
||||
no-rc
|
||||
Do not modify the shell's launch environment to enable integration. Useful if you prefer
|
||||
to :ref:`manually enable integration <manual_shell_integration>`.
|
||||
|
||||
no-cursor
|
||||
Turn off changing of the text cursor to a bar when editing text
|
||||
|
||||
no-title
|
||||
Turn off setting the kitty window/tab title based on shell state
|
||||
|
||||
no-prompt-mark
|
||||
Turn off marking of prompts. This disables jumping to prompt, browsing
|
||||
output of last command and click to move cursor functionality.
|
||||
|
||||
no-complete
|
||||
Turn off completion for the kitty command.
|
||||
|
||||
|
||||
More ways to browse command output
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
You can add further key and mouse bindings to browse the output of commands
|
||||
easily. For example to select the output of a command by right clicking the mouse
|
||||
on the output, define the following in :file:`kitty.conf`:
|
||||
|
||||
.. code:: conf
|
||||
|
||||
mouse_map right press ungrabbed mouse_select_command_output
|
||||
|
||||
Now, when you right click on the output, the entire output is selected, ready
|
||||
to be copied.
|
||||
|
||||
The feature to jump to previous prompts (
|
||||
:sc:`scroll_to_previous_prompt` and :sc:`scroll_to_next_prompt`) and mouse
|
||||
actions (:ref:`action-mouse_select_command_output` and :ref:`action-mouse_show_command_output`) can
|
||||
be integrated with browsing command output as well. For example, define the
|
||||
following mapping in :file:`kitty.conf`:
|
||||
|
||||
.. code:: conf
|
||||
|
||||
map f1 show_last_visited_command_output
|
||||
|
||||
Now, pressing :kbd:`F1` will cause the output of the last jumped to command or
|
||||
the last mouse clicked command output to be opened in a pager for easy browsing.
|
||||
|
||||
In addition, You can define shortcut to get the first command output on screen.
|
||||
For example, define the following in :file:`kitty.conf`:
|
||||
|
||||
.. code:: conf
|
||||
|
||||
map f1 show_first_command_output_on_screen
|
||||
|
||||
Now, pressing :kbd:`F1` will cause the output of the first command output on
|
||||
screen to be opened in a pager.
|
||||
|
||||
You can also add shortcut to scroll to the last jumped position. For example,
|
||||
define the following in :file:`kitty.conf`:
|
||||
|
||||
.. code:: conf
|
||||
|
||||
map f1 scroll_to_prompt 0
|
||||
|
||||
|
||||
How it works
|
||||
-----------------
|
||||
|
||||
At startup, kitty detects if the shell you have configured (either system wide
|
||||
or in kitty.conf) is a supported shell. If so, kitty injects some shell specific
|
||||
code into the shell, to enable shell integration. How it does so varies for
|
||||
different shells.
|
||||
|
||||
|
||||
.. tab:: zsh
|
||||
|
||||
For zsh, kitty sets the ``ZDOTDIR`` environment variable to make zsh load
|
||||
kitty's :file:`.zshenv` which restores the original value of ``ZDOTDIR``
|
||||
and sources the original :file:`.zshenv`. It then loads the shell integration code.
|
||||
The remainder of zsh's startup process proceeds as normal.
|
||||
|
||||
.. tab:: fish
|
||||
|
||||
For fish, to make it automatically load the integration code provided by
|
||||
kitty, the integration script directory path is prepended to the
|
||||
:code:`XDG_DATA_DIRS` environment variable. This is only applied to the fish
|
||||
process and will be cleaned up by the integration script after startup. No files
|
||||
are added or modified.
|
||||
|
||||
.. tab:: bash
|
||||
|
||||
For bash, kitty adds a couple of lines to the bottom of :file:`~/.bashrc`
|
||||
(in an atomic manner) to load the shell integration code.
|
||||
|
||||
|
||||
Then, when launching the shell, kitty sets the environment variable
|
||||
:envvar:`KITTY_SHELL_INTEGRATION` to the value of the :opt:`shell_integration`
|
||||
option. The shell integration code reads the environment variable, turns on the
|
||||
specified integration functionality and then unsets the variable so as to not
|
||||
pollute the system. This has the nice effect that the changes to the shell's rc
|
||||
files become no-ops when running the shell in anything other than kitty itself.
|
||||
|
||||
The actual shell integration code uses hooks provided by each shell to send
|
||||
special escape codes to kitty, to perform the various tasks. You can see the
|
||||
code used for each shell below:
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<details>
|
||||
<summary>Click to toggle shell integration code</summary>
|
||||
|
||||
.. tab:: zsh
|
||||
|
||||
.. literalinclude:: ../shell-integration/zsh/kitty-integration
|
||||
:language: zsh
|
||||
|
||||
|
||||
.. tab:: fish
|
||||
|
||||
.. literalinclude:: ../shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish
|
||||
:language: fish
|
||||
|
||||
.. tab:: bash
|
||||
|
||||
.. literalinclude:: ../shell-integration/bash/kitty.bash
|
||||
:language: bash
|
||||
|
||||
.. raw:: html
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
.. _manual_shell_integration:
|
||||
|
||||
Manual shell integration
|
||||
----------------------------
|
||||
|
||||
The automatic shell integration is designed to be minimally intrusive, as such
|
||||
it wont work for sub-shells, terminal multiplexers, containers, remote systems, etc.
|
||||
For such systems, you should setup manual shell integration by adding some code
|
||||
to your shells startup files to load the shell integration script.
|
||||
|
||||
First, in :file:`kitty.conf` set:
|
||||
|
||||
.. code-block:: conf
|
||||
|
||||
shell_integration disabled
|
||||
|
||||
Then in your shell's rc file, add the lines:
|
||||
|
||||
.. tab:: zsh
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
if test -n "$KITTY_INSTALLATION_DIR"; then
|
||||
export KITTY_SHELL_INTEGRATION="enabled"
|
||||
autoload -Uz -- "$KITTY_INSTALLATION_DIR"/shell-integration/zsh/kitty-integration
|
||||
kitty-integration
|
||||
unfunction kitty-integration
|
||||
fi
|
||||
|
||||
.. tab:: fish
|
||||
|
||||
.. code-block:: fish
|
||||
|
||||
if set -q KITTY_INSTALLATION_DIR
|
||||
set --global KITTY_SHELL_INTEGRATION enabled
|
||||
source "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish"
|
||||
set --prepend fish_complete_path "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_completions.d"
|
||||
end
|
||||
|
||||
|
||||
.. tab:: bash
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
if test -n "$KITTY_INSTALLATION_DIR"; then
|
||||
export KITTY_SHELL_INTEGRATION="enabled"
|
||||
source "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"
|
||||
fi
|
||||
|
||||
The value of :envvar:`KITTY_SHELL_INTEGRATION` is the same as that for
|
||||
:opt:`shell_integration`, except if you want to disable shell integration
|
||||
completely, in which case simply do not set the
|
||||
:envvar:`KITTY_SHELL_INTEGRATION` variable at all.
|
||||
|
||||
If you want this to work while SSHing into a remote system, then you will
|
||||
need to add some code to the snippets above to check if :code:`KITTY_INSTALLATION_DIR`
|
||||
is empty and if so to set it to some hard coded location with the shell
|
||||
integration scripts that need to be copied onto the remote system.
|
||||
|
||||
|
||||
Notes for shell developers
|
||||
-----------------------------
|
||||
|
||||
The protocol used for marking the prompt is very simple. You should consider
|
||||
adding it to your shell as a builtin. Many modern terminals make use of it, for
|
||||
example: kitty, iTerm2, WezTerm, DomTerm
|
||||
|
||||
Just before starting to draw the PS1 prompt send the escape code::
|
||||
|
||||
<OSC>133;A<ST>
|
||||
|
||||
Just before starting to draw the PS2 prompt send the escape code::
|
||||
|
||||
<OSC>133;A;k=s<ST>
|
||||
|
||||
Just before running a command/program, send the escape code::
|
||||
|
||||
<OSC>133;C<ST>
|
||||
|
||||
Here ``<OSC>`` is the bytes ``0x1b 0x5d`` and ``<ST>`` is the bytes ``0x1b
|
||||
0x5c``. This is exactly what is needed for shell integration in kitty. For the
|
||||
full protocol, that also marks the command region, see `the iTerm2 docs
|
||||
<https://iterm2.com/documentation-escape-codes.html>`_.
|
||||
@@ -1,7 +1,12 @@
|
||||
<style>
|
||||
#support-buttons {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.support-button {
|
||||
box-sizing: border-box;
|
||||
border-radius: 6px;
|
||||
box-shadow: rgb(255, 246, 175) 0px 1px 0px 0px;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
color: rgb(51, 51, 51);
|
||||
@@ -10,15 +15,16 @@
|
||||
font-weight: bold;
|
||||
padding: 8px 24px;
|
||||
text-decoration: none;
|
||||
margin-left: 1em;
|
||||
outline: 0;
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
.support-button:hover {
|
||||
transform: scale(1.5);
|
||||
transform: scale(1.2);
|
||||
border: solid 1px rgb(92, 184, 92);
|
||||
}
|
||||
|
||||
.support-button {
|
||||
outline: 0;
|
||||
}
|
||||
.support-button:visited {
|
||||
color: rgb(51, 51, 51);
|
||||
outline: 0;
|
||||
@@ -30,28 +36,34 @@
|
||||
}
|
||||
|
||||
#paypal input[type=submit] {
|
||||
background: linear-gradient(rgb(255, 236, 100) 5%, rgb(255, 171, 35) 100%) rgb(255, 236, 100);
|
||||
border: 1px solid rgb(255, 171, 35);
|
||||
background: linear-gradient(rgb(92, 184, 92) 5%, rgb(62, 142, 62) 100%) rgb(92, 184, 92);
|
||||
padding-top: 10px; padding-bottom: 10px;
|
||||
color: rgb(51, 51, 51);
|
||||
border: 1px solid rgb(92, 184, 92);
|
||||
}
|
||||
|
||||
#liberapay a {
|
||||
a.support-button {
|
||||
background: linear-gradient(rgb(92, 184, 92) 5%, rgb(62, 142, 62) 100%) rgb(92, 184, 92);
|
||||
border: 1px solid rgb(62, 142, 62);
|
||||
color: rgb(51, 51, 51);
|
||||
}
|
||||
|
||||
#patreon a {
|
||||
background: linear-gradient(rgb(11, 100, 163) 5%, rgb(5, 45, 73) 100%) rgb(11, 100, 163);
|
||||
border: 1px solid rgb(5, 45, 73);
|
||||
color: #eee;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="support-buttons">
|
||||
|
||||
<div id="github">
|
||||
<a class="support-button" href="https://github.com/sponsors/kovidgoyal">Patronage via GitHub</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="patreon">
|
||||
<a class="support-button" href="https://www.patreon.com/bePatron?u=917933">Patronage via Patreon</a>
|
||||
</div>
|
||||
|
||||
<div id="liberapay">
|
||||
<a class="support-button" href="https://liberapay.com/kovidgoyal/donate">Patronage via Liberapay</a>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<form id="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" title="Contribute to support calibre development">
|
||||
<input type="hidden" name="cmd" value="_s-xclick" />
|
||||
@@ -61,9 +73,5 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="liberapay">
|
||||
<a class="support-button" href="https://liberapay.com/kovidgoyal/donate">Patronage via Liberapay</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Support kitty development
|
||||
===========================
|
||||
Support kitty development ❤️
|
||||
==============================
|
||||
|
||||
My goal with |kitty| is to move the stagnant terminal ecosystem forward. To that
|
||||
end kitty has many foundational features, such as: :doc:`image support
|
||||
@@ -7,7 +7,7 @@ end kitty has many foundational features, such as: :doc:`image support
|
||||
:doc:`various enhancements to the terminal protocol <protocol-extensions>`,
|
||||
etc. These features allow the development of rich terminal applications, such
|
||||
as :doc:`Side-by-side diff <kittens/diff>` and :doc:`Unicode input
|
||||
<kittens/unicode-input>`.
|
||||
<kittens/unicode_input>`.
|
||||
|
||||
If you wish to support this mission and see the terminal ecosystem evolve,
|
||||
consider donating so that I can devote more time to |kitty| development.
|
||||
@@ -15,8 +15,7 @@ I have personally written `almost all kitty code
|
||||
<https://github.com/kovidgoyal/kitty/graphs/contributors>`_.
|
||||
|
||||
You can choose to make either a one-time payment via PayPal or become a
|
||||
*patron* of kitty development via the Patreon or Liberapay services
|
||||
below:
|
||||
*patron* of kitty development via one of the services below:
|
||||
|
||||
|
||||
.. raw:: html
|
||||
|
||||
@@ -32,3 +32,7 @@ See `discussion here
|
||||
<https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/30>`_.
|
||||
|
||||
.. versionadded:: 0.20.2
|
||||
|
||||
Also supported by the terminals:
|
||||
|
||||
* `mintty <https://github.com/mintty/mintty/releases/tag/3.5.2>`_
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPLv3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
import subprocess
|
||||
|
||||
@@ -1,14 +1,41 @@
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPLv3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
|
||||
import re
|
||||
from typing import List
|
||||
|
||||
from kitty.conf.generate import write_output
|
||||
|
||||
|
||||
def patch_color_list(path: str, colors: List[str], name: str, spc: str = ' ') -> None:
|
||||
with open(path, 'r+') as f:
|
||||
raw = f.read()
|
||||
nraw = re.sub(
|
||||
fr'(# {name}_COLORS_START).+?(\s+# {name}_COLORS_END)',
|
||||
r'\1' + f'\n{spc}' + f'\n{spc}'.join(map(lambda x: f'{x!r},', sorted(colors))) + r'\2',
|
||||
raw, flags=re.DOTALL | re.MULTILINE)
|
||||
if nraw != raw:
|
||||
f.seek(0)
|
||||
f.truncate()
|
||||
f.write(nraw)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
from kitty.options.definition import definition
|
||||
write_output('kitty', definition)
|
||||
nullable_colors = []
|
||||
all_colors = []
|
||||
for opt in definition.iter_all_options():
|
||||
if callable(opt.parser_func):
|
||||
if opt.parser_func.__name__ in ('to_color_or_none', 'cursor_text_color'):
|
||||
nullable_colors.append(opt.name)
|
||||
all_colors.append(opt.name)
|
||||
elif opt.parser_func.__name__ in ('to_color', 'titlebar_color', 'macos_titlebar_color'):
|
||||
all_colors.append(opt.name)
|
||||
patch_color_list('kitty/rc/set_colors.py', nullable_colors, 'NULLABLE')
|
||||
patch_color_list('kittens/themes/collection.py', all_colors, 'ALL', ' ' * 8)
|
||||
|
||||
from kittens.diff.options.definition import definition as kd
|
||||
write_output('kittens.diff', kd)
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPLv3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
import string
|
||||
@@ -245,7 +244,7 @@ def patch_file(path: str, what: str, text: str, start_marker: str = '/* ', end_m
|
||||
f.write(raw)
|
||||
|
||||
|
||||
def serialize_dict(x: dict) -> str:
|
||||
def serialize_dict(x: Dict[Any, Any]) -> str:
|
||||
return pformat(x, indent=4).replace('{', '{\n ', 1)
|
||||
|
||||
|
||||
@@ -349,7 +348,7 @@ def generate_legacy_text_key_maps() -> None:
|
||||
patch_file('kitty_tests/keys.py', 'legacy letter tests', '\n'.join(tests), start_marker='# ', end_marker='')
|
||||
|
||||
|
||||
def chunks(lst: List, n: int) -> Any:
|
||||
def chunks(lst: List[Any], n: int) -> Any:
|
||||
"""Yield successive n-sized chunks from lst."""
|
||||
for i in range(0, len(lst), n):
|
||||
yield lst[i:i + n]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPL v3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
import os
|
||||
@@ -50,10 +49,25 @@ class_maps: Dict[str, Set[int]] = {}
|
||||
all_symbols: Set[int] = set()
|
||||
name_map: Dict[int, str] = {}
|
||||
word_search_map: DefaultDict[str, Set[int]] = defaultdict(set)
|
||||
zwj = 0x200d
|
||||
soft_hyphen = 0xad
|
||||
flag_codepoints = frozenset(range(0x1F1E6, 0x1F1E6 + 26))
|
||||
marks = set(emoji_skin_tone_modifiers) | {zwj} | flag_codepoints
|
||||
# See https://github.com/harfbuzz/harfbuzz/issues/169
|
||||
marks = set(emoji_skin_tone_modifiers) | flag_codepoints
|
||||
not_assigned = set(range(0, sys.maxunicode))
|
||||
property_maps: Dict[str, Set[int]] = defaultdict(set)
|
||||
|
||||
|
||||
def parse_prop_list() -> None:
|
||||
global marks
|
||||
for line in get_data('ucd/PropList.txt'):
|
||||
if line.startswith('#'):
|
||||
continue
|
||||
cp_or_range, rest = line.split(';', 1)
|
||||
chars = parse_range_spec(cp_or_range.strip())
|
||||
name = rest.strip().split()[0]
|
||||
property_maps[name] |= chars
|
||||
# see https://www.unicode.org/faq/unsup_char.html#3
|
||||
marks |= property_maps['Other_Default_Ignorable_Code_Point']
|
||||
|
||||
|
||||
def parse_ucd() -> None:
|
||||
@@ -97,6 +111,12 @@ def parse_ucd() -> None:
|
||||
marks.add(codepoint)
|
||||
elif category.startswith('S'):
|
||||
all_symbols.add(codepoint)
|
||||
elif category == 'Cf':
|
||||
# we add Cf to marks as it contains things like tags and zero
|
||||
# width chars. Not sure if *all* of Cf should be treated as
|
||||
# combining chars, might need to add individual exceptions in
|
||||
# the future.
|
||||
marks.add(codepoint)
|
||||
|
||||
with open('nerd-fonts-glyphs.txt') as f:
|
||||
for line in f:
|
||||
@@ -213,7 +233,7 @@ def parse_eaw() -> None:
|
||||
if eaw == 'A':
|
||||
ambiguous |= chars
|
||||
seen |= chars
|
||||
elif eaw == 'W' or eaw == 'F':
|
||||
elif eaw in ('W', 'F'):
|
||||
doublewidth |= chars
|
||||
seen |= chars
|
||||
doublewidth |= set(range(0x3400, 0x4DBF + 1)) - seen
|
||||
@@ -234,15 +254,15 @@ def get_ranges(items: List[int]) -> Generator[Union[int, Tuple[int, int]], None,
|
||||
yield a, b
|
||||
|
||||
|
||||
def write_case(spec: Union[Tuple, int], p: Callable) -> None:
|
||||
def write_case(spec: Union[Tuple[int, ...], int], p: Callable[..., None]) -> None:
|
||||
if isinstance(spec, tuple):
|
||||
p('\t\tcase 0x{:x} ... 0x{:x}:'.format(*spec))
|
||||
else:
|
||||
p('\t\tcase 0x{:x}:'.format(spec))
|
||||
p(f'\t\tcase 0x{spec:x}:')
|
||||
|
||||
|
||||
@contextmanager
|
||||
def create_header(path: str, include_data_types: bool = True) -> Generator[Callable, None, None]:
|
||||
def create_header(path: str, include_data_types: bool = True) -> Generator[Callable[..., None], None, None]:
|
||||
with open(path, 'w') as f:
|
||||
p = partial(print, file=f)
|
||||
p('// unicode data, built from the unicode standard on:', date.today())
|
||||
@@ -282,7 +302,7 @@ def gen_emoji() -> None:
|
||||
|
||||
def category_test(
|
||||
name: str,
|
||||
p: Callable,
|
||||
p: Callable[..., None],
|
||||
classes: Iterable[str],
|
||||
comment: str,
|
||||
use_static: bool = False,
|
||||
@@ -312,7 +332,7 @@ def category_test(
|
||||
p('\treturn false;\n}\n')
|
||||
|
||||
|
||||
def codepoint_to_mark_map(p: Callable, mark_map: List[int]) -> Dict[int, int]:
|
||||
def codepoint_to_mark_map(p: Callable[..., None], mark_map: List[int]) -> Dict[int, int]:
|
||||
p('\tswitch(c) { // {{{')
|
||||
rmap = {c: m for m, c in enumerate(mark_map)}
|
||||
for spec in get_ranges(mark_map):
|
||||
@@ -336,10 +356,10 @@ def classes_to_regex(classes: Iterable[str], exclude: str = '') -> Iterable[str]
|
||||
|
||||
def as_string(codepoint: int) -> str:
|
||||
if codepoint < 256:
|
||||
return r'\x{:02x}'.format(codepoint)
|
||||
return fr'\x{codepoint:02x}'
|
||||
if codepoint <= 0xffff:
|
||||
return r'\u{:04x}'.format(codepoint)
|
||||
return r'\U{:08x}'.format(codepoint)
|
||||
return fr'\u{codepoint:04x}'
|
||||
return fr'\U{codepoint:08x}'
|
||||
|
||||
for spec in get_ranges(list(chars)):
|
||||
if isinstance(spec, tuple):
|
||||
@@ -354,16 +374,21 @@ def gen_ucd() -> None:
|
||||
p('#include "unicode-data.h"')
|
||||
category_test(
|
||||
'is_combining_char', p,
|
||||
{c for c in class_maps if c.startswith('M')},
|
||||
'M category (marks)',
|
||||
# See https://github.com/harfbuzz/harfbuzz/issues/169
|
||||
extra_chars=emoji_skin_tone_modifiers | {zwj},
|
||||
(),
|
||||
'Combining and default ignored characters',
|
||||
extra_chars=marks,
|
||||
least_check_return='false'
|
||||
)
|
||||
category_test(
|
||||
'is_ignored_char', p, 'Cc Cf Cs'.split(),
|
||||
'is_ignored_char', p, 'Cc Cs'.split(),
|
||||
'Control characters and non-characters',
|
||||
extra_chars=non_characters, exclude={zwj},
|
||||
extra_chars=non_characters,
|
||||
ascii_range='false'
|
||||
)
|
||||
category_test(
|
||||
'is_non_rendered_char', p, 'Cc Cs Cf'.split(),
|
||||
'Other_Default_Ignorable_Code_Point and soft hyphen',
|
||||
extra_chars=property_maps['Other_Default_Ignorable_Code_Point'] | set(range(0xfe00, 0xfe0f + 1)),
|
||||
ascii_range='false'
|
||||
)
|
||||
category_test('is_word_char', p, {c for c in class_maps if c[0] in 'LN'}, 'L and N categories')
|
||||
@@ -378,15 +403,19 @@ def gen_ucd() -> None:
|
||||
p('combining_type mark_for_codepoint(char_type c) {')
|
||||
rmap = codepoint_to_mark_map(p, mark_map)
|
||||
p('}\n')
|
||||
with open('kitty/unicode-data.h') as f:
|
||||
unicode_data = f.read()
|
||||
m = re.search(r'^#define VS15 (\d+)', unicode_data, re.M)
|
||||
if m is not None:
|
||||
expected = int(m.group(1))
|
||||
if rmap[0xfe0e] != expected:
|
||||
raise ValueError('The mark for 0xfe0e has changed, you have to update VS15 to {} and VS16 to {} in unicode-data.h'.format(
|
||||
rmap[0xfe0e], rmap[0xfe0f]
|
||||
))
|
||||
with open('kitty/unicode-data.h', 'r+') as f:
|
||||
raw = f.read()
|
||||
f.seek(0)
|
||||
raw, num = re.subn(
|
||||
r'^// START_KNOWN_MARKS.+?^// END_KNOWN_MARKS',
|
||||
'// START_KNOWN_MARKS\nstatic const combining_type '
|
||||
f'VS15 = {rmap[0xfe0e]}, VS16 = {rmap[0xfe0f]};'
|
||||
'\n// END_KNOWN_MARKS', raw, flags=re.MULTILINE | re.DOTALL)
|
||||
if not num:
|
||||
raise SystemExit('Faile dto patch mark definitions in unicode-data.h')
|
||||
f.truncate()
|
||||
f.write(raw)
|
||||
|
||||
with open('kittens/hints/url_regex.py', 'w') as f:
|
||||
f.write('# generated by gen-wcwidth.py, do not edit\n\n')
|
||||
f.write("url_delimiters = '{}' # noqa".format(''.join(classes_to_regex(cz, exclude='\n\r'))))
|
||||
@@ -496,7 +525,7 @@ def gen_names() -> None:
|
||||
def gen_wcwidth() -> None:
|
||||
seen: Set[int] = set()
|
||||
|
||||
def add(p: Callable, comment: str, chars_: Union[Set[int], FrozenSet[int]], ret: int) -> None:
|
||||
def add(p: Callable[..., None], comment: str, chars_: Union[Set[int], FrozenSet[int]], ret: int) -> None:
|
||||
chars = chars_ - seen
|
||||
seen.update(chars)
|
||||
p(f'\t\t// {comment} ({len(chars)} codepoints)' + ' {{' '{')
|
||||
@@ -537,6 +566,7 @@ def gen_wcwidth() -> None:
|
||||
|
||||
|
||||
parse_ucd()
|
||||
parse_prop_list()
|
||||
parse_emoji()
|
||||
parse_eaw()
|
||||
gen_ucd()
|
||||
|
||||
6
glfw/backend_utils.c
vendored
@@ -91,7 +91,7 @@ compare_timers(const void *a_, const void *b_) {
|
||||
return (a->trigger_at > b->trigger_at) ? 1 : (a->trigger_at < b->trigger_at) ? -1 : 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
static void
|
||||
update_timers(EventLoopData *eld) {
|
||||
if (eld->timers_count > 1) qsort(eld->timers, eld->timers_count, sizeof(eld->timers[0]), compare_timers);
|
||||
}
|
||||
@@ -164,7 +164,7 @@ prepareForPoll(EventLoopData *eld, monotonic_t timeout) {
|
||||
return timeout;
|
||||
}
|
||||
|
||||
static inline struct timespec
|
||||
static struct timespec
|
||||
calc_time(monotonic_t nsec) {
|
||||
struct timespec result;
|
||||
result.tv_sec = nsec / (1000LL * 1000LL * 1000LL);
|
||||
@@ -271,7 +271,7 @@ wakeupEventLoop(EventLoopData *eld) {
|
||||
}
|
||||
|
||||
#ifndef HAS_EVENT_FD
|
||||
static inline void
|
||||
static void
|
||||
closeFds(int *fds, size_t count) {
|
||||
while(count--) {
|
||||
if (*fds > 0) {
|
||||
|
||||
@@ -453,24 +453,74 @@ void* _glfwLoadLocalVulkanLoaderNS(void)
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static inline bool
|
||||
is_ctrl_tab(NSEvent *event, NSEventModifierFlags modifierFlags) {
|
||||
static bool
|
||||
is_modified_tab(NSEvent *event, NSEventModifierFlags modifierFlags) {
|
||||
switch ((NSUInteger)modifierFlags) {
|
||||
// No need to handle shift+tab, [shift]+option+tab
|
||||
case NSEventModifierFlagShift:
|
||||
case NSEventModifierFlagOption:
|
||||
case (NSEventModifierFlagShift | NSEventModifierFlagOption):
|
||||
// Do not intercept cmd+tab, shift+cmd+tab
|
||||
case NSEventModifierFlagCommand:
|
||||
case (NSEventModifierFlagShift | NSEventModifierFlagCommand):
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// ctrl+whatever+tab, option+cmd+tab
|
||||
if (
|
||||
(modifierFlags == NSEventModifierFlagControl &&
|
||||
[event.charactersIgnoringModifiers isEqualToString:@"\t"]) ||
|
||||
(modifierFlags == (NSEventModifierFlagControl | NSEventModifierFlagShift) &&
|
||||
[event.charactersIgnoringModifiers isEqualToString:@"\x19"])
|
||||
(
|
||||
(modifierFlags & NSEventModifierFlagControl) ||
|
||||
modifierFlags == (NSEventModifierFlagOption | NSEventModifierFlagCommand)
|
||||
) && [event.charactersIgnoringModifiers isEqualToString:@"\t"]
|
||||
) return true;
|
||||
// shift+whatever+tab
|
||||
if (
|
||||
(modifierFlags & NSEventModifierFlagShift) &&
|
||||
[event.charactersIgnoringModifiers isEqualToString:@"\x19"]
|
||||
) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
is_cmd_period(NSEvent *event, NSEventModifierFlags modifierFlags) {
|
||||
if (modifierFlags != NSEventModifierFlagCommand) return false;
|
||||
if ([event.charactersIgnoringModifiers isEqualToString:@"."]) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool
|
||||
is_modified_special_key(NSEvent *event, NSEventModifierFlags modifierFlags) {
|
||||
// really one should use [[NSUserDefaults standardUserDefaults] valueForDefaultsDomain:@"com.apple.symbolichotkeys" key:@"AppleSymbolicHotKeys"]
|
||||
// to get the list of global shortcuts and pass through the important ones,
|
||||
// see https://stackoverflow.com/questions/21878482/what-do-the-parameter-values-in-applesymbolichotkeys-plist-dict-represent
|
||||
// however given that in order to know which integers are which actions in that dict one needs reverse engineering
|
||||
// see https://stackoverflow.com/questions/866056/how-do-i-programmatically-get-the-shortcut-keys-reserved-by-mac-os-x
|
||||
// it's too much effort.
|
||||
if ([event.charactersIgnoringModifiers length] != 1) return false;
|
||||
const unichar ch = [event.charactersIgnoringModifiers characterAtIndex:0];
|
||||
if (modifierFlags == (NSEventModifierFlagControl | NSEventModifierFlagShift)) {
|
||||
switch (ch) {
|
||||
case 0x1b: // Esc
|
||||
case NSF1FunctionKey: case NSF2FunctionKey: case NSF3FunctionKey: case NSF4FunctionKey:
|
||||
case NSF5FunctionKey: case NSF6FunctionKey: case NSF7FunctionKey: case NSF8FunctionKey:
|
||||
case NSF9FunctionKey: case NSF10FunctionKey: case NSF11FunctionKey: case NSF12FunctionKey:
|
||||
case NSF13FunctionKey: case NSF14FunctionKey: case NSF15FunctionKey: case NSF16FunctionKey:
|
||||
case NSF17FunctionKey: case NSF18FunctionKey: case NSF19FunctionKey:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
switch (ch) {
|
||||
case 0x1b: // Esc
|
||||
if (modifierFlags & (NSEventModifierFlagCommand | NSEventModifierFlagControl)) return true;
|
||||
break;
|
||||
case NSHelpFunctionKey: // For some reason keyboards with an insert key have it mapped to help
|
||||
if (!modifierFlags || modifierFlags == NSEventModifierFlagShift) return true;
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
GLFWAPI GLFWapplicationshouldhandlereopenfun glfwSetApplicationShouldHandleReopen(GLFWapplicationshouldhandlereopenfun callback) {
|
||||
GLFWapplicationshouldhandlereopenfun previous = handle_reopen_callback;
|
||||
handle_reopen_callback = callback;
|
||||
@@ -510,10 +560,11 @@ int _glfwPlatformInit(void)
|
||||
|
||||
NSEvent* (^keydown_block)(NSEvent*) = ^ NSEvent* (NSEvent* event)
|
||||
{
|
||||
NSEventModifierFlags modifierFlags = [event modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask;
|
||||
if (is_ctrl_tab(event, modifierFlags) || is_cmd_period(event, modifierFlags)) {
|
||||
// Cocoa swallows Ctrl+Tab to cycle between views
|
||||
NSEventModifierFlags modifierFlags = [event modifierFlags] & (NSEventModifierFlagShift | NSEventModifierFlagOption | NSEventModifierFlagCommand | NSEventModifierFlagControl);
|
||||
if (is_modified_special_key(event, modifierFlags) || is_modified_tab(event, modifierFlags) || is_cmd_period(event, modifierFlags)) {
|
||||
// Cocoa swallows various key presses, so route them explicitly
|
||||
[[NSApp keyWindow].contentView keyDown:event];
|
||||
return nil;
|
||||
}
|
||||
|
||||
return event;
|
||||
@@ -521,16 +572,17 @@ int _glfwPlatformInit(void)
|
||||
|
||||
NSEvent* (^keyup_block)(NSEvent*) = ^ NSEvent* (NSEvent* event)
|
||||
{
|
||||
NSEventModifierFlags modifierFlags = [event modifierFlags] & NSEventModifierFlagDeviceIndependentFlagsMask;
|
||||
NSEventModifierFlags modifierFlags = [event modifierFlags] & (NSEventModifierFlagShift | NSEventModifierFlagOption | NSEventModifierFlagCommand | NSEventModifierFlagControl);
|
||||
if (modifierFlags & NSEventModifierFlagCommand) {
|
||||
// From http://cocoadev.com/index.pl?GameKeyboardHandlingAlmost
|
||||
// From https://cocoadev.github.io/GameKeyboardHandlingAlmost/
|
||||
// This works around an AppKit bug, where key up events while holding
|
||||
// down the command key don't get sent to the key window.
|
||||
[[NSApp keyWindow] sendEvent:event];
|
||||
}
|
||||
if (is_ctrl_tab(event, modifierFlags) || is_cmd_period(event, modifierFlags)) {
|
||||
// Cocoa swallows Ctrl+Tab to cycle between views
|
||||
if (is_modified_special_key(event, modifierFlags) || is_modified_tab(event, modifierFlags) || is_cmd_period(event, modifierFlags)) {
|
||||
// Cocoa swallows various key presses, so route them explicitly
|
||||
[[NSApp keyWindow].contentView keyUp:event];
|
||||
return nil;
|
||||
}
|
||||
|
||||
return event;
|
||||
@@ -703,7 +755,7 @@ typedef struct {
|
||||
static Timer timers[128] = {{0}};
|
||||
static size_t num_timers = 0;
|
||||
|
||||
static inline void
|
||||
static void
|
||||
remove_timer_at(size_t idx) {
|
||||
if (idx < num_timers) {
|
||||
Timer *t = timers + idx;
|
||||
|
||||
@@ -61,7 +61,7 @@ getDisplayName(CGDirectDisplayID displayID, NSScreen* screen)
|
||||
io_service_t service;
|
||||
CFDictionaryRef info;
|
||||
|
||||
if (IOServiceGetMatchingServices(kIOMainPortDefault,
|
||||
if (IOServiceGetMatchingServices(0,
|
||||
IOServiceMatching("IODisplayConnect"),
|
||||
&it) != 0)
|
||||
{
|
||||
@@ -259,7 +259,7 @@ static double getFallbackRefreshRate(CGDirectDisplayID displayID)
|
||||
io_iterator_t it;
|
||||
io_service_t service;
|
||||
|
||||
if (IOServiceGetMatchingServices(kIOMainPortDefault,
|
||||
if (IOServiceGetMatchingServices(0,
|
||||
IOServiceMatching("IOFramebuffer"),
|
||||
&it) != 0)
|
||||
{
|
||||
|
||||
3
glfw/cocoa_platform.h
vendored
@@ -39,9 +39,6 @@ typedef void* CVDisplayLinkRef;
|
||||
// NOTE: Many Cocoa enum values have been renamed and we need to build across
|
||||
// SDK versions where one is unavailable or the other deprecated
|
||||
// We use the newer names in code and these macros to handle compatibility
|
||||
#if (MAC_OS_X_VERSION_MAX_ALLOWED < 120000) // Before macOS 12 Monterey
|
||||
#define kIOMainPortDefault kIOMasterPortDefault
|
||||
#endif
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 101200
|
||||
#define NSBitmapFormatAlphaNonpremultiplied NSAlphaNonpremultipliedBitmapFormat
|
||||
#define NSEventMaskAny NSAnyEventMask
|
||||
|
||||
@@ -38,6 +38,16 @@
|
||||
#define NSControlStateValueMixed NSMixedState
|
||||
#endif
|
||||
|
||||
static const char*
|
||||
polymorphic_string_as_utf8(id string) {
|
||||
if (string == nil) return "(nil)";
|
||||
NSString* characters;
|
||||
if ([string isKindOfClass:[NSAttributedString class]])
|
||||
characters = [string string];
|
||||
else
|
||||
characters = (NSString*) string;
|
||||
return [characters UTF8String];
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
vk_code_to_functional_key_code(uint8_t key_code) { // {{{
|
||||
@@ -233,10 +243,10 @@ mac_ucode_to_functional(uint32_t key_code) { // {{{
|
||||
}
|
||||
} // }}}
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
is_surrogate(UniChar uc) { return (uc - 0xd800u) < 2048u; }
|
||||
|
||||
static inline uint32_t
|
||||
static uint32_t
|
||||
get_first_codepoint(UniChar *utf16, UniCharCount num) {
|
||||
if (!num) return 0;
|
||||
if (!is_surrogate(*utf16)) return *utf16;
|
||||
@@ -244,7 +254,7 @@ get_first_codepoint(UniChar *utf16, UniCharCount num) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
is_pua_char(uint32_t ch) {
|
||||
return (0xE000 <= ch && ch <= 0xF8FF) || (0xF0000 <= ch && ch <= 0xFFFFF) || (0x100000 <= ch && ch <= 0x10FFFF);
|
||||
}
|
||||
@@ -321,7 +331,7 @@ _glfwShutdownCVDisplayLink(unsigned long long timer_id UNUSED, void *user_data U
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
static void
|
||||
requestRenderFrame(_GLFWwindow *w, GLFWcocoarenderframefun callback) {
|
||||
if (!callback) {
|
||||
w->ns.renderFrameRequested = false;
|
||||
@@ -505,7 +515,7 @@ translateFlags(NSUInteger flags)
|
||||
|
||||
#define debug_key(...) if (_glfw.hints.init.debugKeyboard) { fprintf(stderr, __VA_ARGS__); fflush(stderr); }
|
||||
|
||||
static inline const char*
|
||||
static const char*
|
||||
format_mods(int mods) {
|
||||
static char buf[128];
|
||||
char *p = buf, *s;
|
||||
@@ -525,7 +535,7 @@ format_mods(int mods) {
|
||||
return buf;
|
||||
}
|
||||
|
||||
static inline const char*
|
||||
static const char*
|
||||
format_text(const char *src) {
|
||||
static char buf[256];
|
||||
char *p = buf;
|
||||
@@ -561,6 +571,11 @@ translateKey(uint16_t vk_key, bool apply_keymap)
|
||||
return ans;
|
||||
}
|
||||
|
||||
static NSRect
|
||||
get_window_size_without_border_in_logical_pixels(_GLFWwindow *window) {
|
||||
return [window->ns.object contentRectForFrameRect:[window->ns.object frame]];
|
||||
}
|
||||
|
||||
// Translate a GLFW keycode to a Cocoa modifier flag
|
||||
//
|
||||
static NSUInteger
|
||||
@@ -766,7 +781,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
||||
_glfwInputWindowMaximize(window, maximized);
|
||||
}
|
||||
|
||||
const NSRect contentRect = [window->ns.view frame];
|
||||
const NSRect contentRect = get_window_size_without_border_in_logical_pixels(window);
|
||||
const NSRect fbRect = [window->ns.view convertRectToBacking:contentRect];
|
||||
|
||||
if (fbRect.size.width != window->ns.fbWidth ||
|
||||
@@ -849,6 +864,12 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
||||
showCursor(window);
|
||||
|
||||
_glfwInputWindowFocus(window, false);
|
||||
// IME is cancelled when losing the focus
|
||||
if ([window->ns.view hasMarkedText]) {
|
||||
[window->ns.view unmarkText];
|
||||
GLFWkeyevent dummy = {.action = GLFW_RELEASE, .ime_state = GLFW_IME_PREEDIT_CHANGED};
|
||||
_glfwInputKeyboard(window, &dummy);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)windowDidChangeScreen:(NSNotification *)notification
|
||||
@@ -872,6 +893,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
||||
NSTrackingArea* trackingArea;
|
||||
NSMutableAttributedString* markedText;
|
||||
NSRect markedRect;
|
||||
bool marked_text_cleared_by_insert;
|
||||
NSString *input_source_at_last_key_event;
|
||||
}
|
||||
|
||||
@@ -1088,7 +1110,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
||||
- (void)viewDidChangeBackingProperties
|
||||
{
|
||||
if (!window) return;
|
||||
const NSRect contentRect = [window->ns.view frame];
|
||||
const NSRect contentRect = get_window_size_without_border_in_logical_pixels(window);
|
||||
const NSRect fbRect = [window->ns.view convertRectToBacking:contentRect];
|
||||
|
||||
if (fbRect.size.width != window->ns.fbWidth ||
|
||||
@@ -1144,7 +1166,7 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
|
||||
[super updateTrackingAreas];
|
||||
}
|
||||
|
||||
static inline UInt32
|
||||
static UInt32
|
||||
convert_cocoa_to_carbon_modifiers(NSUInteger flags) {
|
||||
UInt32 mods = 0;
|
||||
if (flags & NSEventModifierFlagShift)
|
||||
@@ -1161,7 +1183,7 @@ convert_cocoa_to_carbon_modifiers(NSUInteger flags) {
|
||||
return (mods >> 8) & 0xFF;
|
||||
}
|
||||
|
||||
static inline void
|
||||
static void
|
||||
convert_utf16_to_utf8(UniChar *src, UniCharCount src_length, char *dest, size_t dest_sz) {
|
||||
CFStringRef string = CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault,
|
||||
src,
|
||||
@@ -1174,12 +1196,12 @@ convert_utf16_to_utf8(UniChar *src, UniCharCount src_length, char *dest, size_t
|
||||
CFRelease(string);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
alternate_key_is_ok(uint32_t key, uint32_t akey) {
|
||||
return akey > 31 && akey != key && !is_pua_char(akey);
|
||||
}
|
||||
|
||||
static inline void
|
||||
static void
|
||||
add_alternate_keys(GLFWkeyevent *ev, NSEvent *event) {
|
||||
ev->alternate_key = translateKey(ev->native_key, false);
|
||||
if (!alternate_key_is_ok(ev->key, ev->alternate_key)) ev->alternate_key = 0;
|
||||
@@ -1198,19 +1220,27 @@ add_alternate_keys(GLFWkeyevent *ev, NSEvent *event) {
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
is_ascii_control_char(char x) {
|
||||
return x == 0 || (1 <= x && x <= 31) || x == 127;
|
||||
}
|
||||
|
||||
- (void)keyDown:(NSEvent *)event
|
||||
{
|
||||
#define CLEAR_PRE_EDIT_TEXT glfw_keyevent.text = NULL; glfw_keyevent.ime_state = GLFW_IME_PREEDIT_CHANGED; _glfwInputKeyboard(window, &glfw_keyevent);
|
||||
#define UPDATE_PRE_EDIT_TEXT glfw_keyevent.text = [[markedText string] UTF8String]; glfw_keyevent.ime_state = GLFW_IME_PREEDIT_CHANGED; _glfwInputKeyboard(window, &glfw_keyevent);
|
||||
|
||||
const bool previous_has_marked_text = [self hasMarkedText];
|
||||
bool input_source_changed = false;
|
||||
NSTextInputContext *inpctx = [NSTextInputContext currentInputContext];
|
||||
if (inpctx && (!input_source_at_last_key_event || ![input_source_at_last_key_event isEqualToString:inpctx.selectedKeyboardInputSource])) {
|
||||
if (input_source_at_last_key_event) {
|
||||
debug_key("Input source changed, clearing pre-edit text and resetting deadkey state\n");
|
||||
GLFWkeyevent dummy = {.action = GLFW_RELEASE, .ime_state = GLFW_IME_PREEDIT_CHANGED};
|
||||
window->ns.deadKeyState = 0;
|
||||
_glfwInputKeyboard(window, &dummy); // clear pre-edit text
|
||||
}
|
||||
input_source_at_last_key_event = [inpctx.selectedKeyboardInputSource retain];
|
||||
input_source_changed = true;
|
||||
[self unmarkText];
|
||||
}
|
||||
|
||||
const unsigned int keycode = [event keyCode];
|
||||
@@ -1218,9 +1248,9 @@ is_ascii_control_char(char x) {
|
||||
const int mods = translateFlags(flags);
|
||||
const uint32_t key = translateKey(keycode, true);
|
||||
const bool process_text = !window->ns.textInputFilterCallback || window->ns.textInputFilterCallback(key, mods, keycode, flags) != 1;
|
||||
[self unmarkText];
|
||||
_glfw.ns.text[0] = 0;
|
||||
GLFWkeyevent glfw_keyevent = {.key = key, .native_key = keycode, .action = GLFW_PRESS, .mods = mods};
|
||||
if (keycode == 0x33 /* backspace */ || keycode == 0x35 /* escape */) [self unmarkText];
|
||||
GLFWkeyevent glfw_keyevent = {.key = key, .native_key = keycode, .native_key_id = keycode, .action = GLFW_PRESS, .mods = mods};
|
||||
if (!_glfw.ns.unicodeData) {
|
||||
// Using the cocoa API for key handling is disabled, as there is no
|
||||
// reliable way to handle dead keys using it. Only use it if the
|
||||
@@ -1230,14 +1260,6 @@ is_ascii_control_char(char x) {
|
||||
[self interpretKeyEvents:[NSArray arrayWithObject:event]];
|
||||
}
|
||||
} else {
|
||||
if (input_source_changed) {
|
||||
debug_key("Input source changed, clearing pre-edit text and resetting deadkey state\n");
|
||||
glfw_keyevent.text = NULL;
|
||||
glfw_keyevent.ime_state = GLFW_IME_PREEDIT_CHANGED;
|
||||
window->ns.deadKeyState = 0;
|
||||
_glfwInputKeyboard(window, &glfw_keyevent); // clear pre-edit text
|
||||
}
|
||||
|
||||
static UniChar text[256];
|
||||
UniCharCount char_count = 0;
|
||||
const bool in_compose_sequence = window->ns.deadKeyState != 0;
|
||||
@@ -1260,6 +1282,7 @@ is_ascii_control_char(char x) {
|
||||
}
|
||||
debug_key("\x1b[31mPress:\x1b[m native_key: 0x%x (%s) glfw_key: 0x%x %schar_count: %lu deadKeyState: %u repeat: %d ",
|
||||
keycode, safe_name_for_keycode(keycode), key, format_mods(mods), char_count, window->ns.deadKeyState, event.ARepeat);
|
||||
marked_text_cleared_by_insert = false;
|
||||
if (process_text) {
|
||||
// this will call insertText which will fill up _glfw.ns.text
|
||||
[self interpretKeyEvents:[NSArray arrayWithObject:event]];
|
||||
@@ -1268,41 +1291,46 @@ is_ascii_control_char(char x) {
|
||||
}
|
||||
if (window->ns.deadKeyState && (char_count == 0 || keycode == 0x75)) {
|
||||
// 0x75 is the delete key which needs to be ignored during a compose sequence
|
||||
glfw_keyevent.text = [[markedText string] UTF8String];
|
||||
debug_key("Sending pre-edit text for dead key (text: %s markedText: %s).\n", format_text(_glfw.ns.text), glfw_keyevent.text);
|
||||
glfw_keyevent.ime_state = GLFW_IME_PREEDIT_CHANGED;
|
||||
_glfwInputKeyboard(window, &glfw_keyevent); // update pre-edit text
|
||||
UPDATE_PRE_EDIT_TEXT;
|
||||
return;
|
||||
}
|
||||
if (in_compose_sequence) {
|
||||
debug_key("Clearing pre-edit text at end of compose sequence\n");
|
||||
glfw_keyevent.text = NULL;
|
||||
glfw_keyevent.ime_state = GLFW_IME_PREEDIT_CHANGED;
|
||||
_glfwInputKeyboard(window, &glfw_keyevent); // clear pre-edit text
|
||||
CLEAR_PRE_EDIT_TEXT;
|
||||
}
|
||||
}
|
||||
if (is_ascii_control_char(_glfw.ns.text[0])) _glfw.ns.text[0] = 0; // don't send text for ascii control codes
|
||||
debug_key("text: %s glfw_key: %s marked_text: %s\n",
|
||||
debug_key("text: %s glfw_key: %s marked_text: (%s)\n",
|
||||
format_text(_glfw.ns.text), _glfwGetKeyName(key), [[markedText string] UTF8String]);
|
||||
bool bracketed_ime = false;
|
||||
if (!window->ns.deadKeyState) {
|
||||
if ([self hasMarkedText]) {
|
||||
glfw_keyevent.text = [[markedText string] UTF8String];
|
||||
glfw_keyevent.ime_state = GLFW_IME_PREEDIT_CHANGED;
|
||||
_glfwInputKeyboard(window, &glfw_keyevent); // update pre-edit text
|
||||
if (!marked_text_cleared_by_insert) {
|
||||
UPDATE_PRE_EDIT_TEXT;
|
||||
} else bracketed_ime = true;
|
||||
} else if (previous_has_marked_text) {
|
||||
glfw_keyevent.text = NULL;
|
||||
glfw_keyevent.ime_state = GLFW_IME_PREEDIT_CHANGED;
|
||||
_glfwInputKeyboard(window, &glfw_keyevent); // clear pre-edit text
|
||||
CLEAR_PRE_EDIT_TEXT;
|
||||
}
|
||||
if (([self hasMarkedText] || previous_has_marked_text) && !_glfw.ns.text[0]) {
|
||||
// do not pass keys like BACKSPACE while there's pre-edit text, let IME handle it
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (bracketed_ime) {
|
||||
// insertText followed by setMarkedText
|
||||
CLEAR_PRE_EDIT_TEXT;
|
||||
}
|
||||
glfw_keyevent.text = _glfw.ns.text;
|
||||
glfw_keyevent.ime_state = GLFW_IME_NONE;
|
||||
add_alternate_keys(&glfw_keyevent, event);
|
||||
_glfwInputKeyboard(window, &glfw_keyevent);
|
||||
if (bracketed_ime) {
|
||||
// insertText followed by setMarkedText
|
||||
UPDATE_PRE_EDIT_TEXT;
|
||||
}
|
||||
#undef CLEAR_PRE_EDIT_TEXT
|
||||
#undef UPDATE_PRE_EDIT_TEXT
|
||||
}
|
||||
|
||||
- (void)flagsChanged:(NSEvent *)event
|
||||
@@ -1329,7 +1357,7 @@ is_ascii_control_char(char x) {
|
||||
action = GLFW_PRESS;
|
||||
}
|
||||
|
||||
GLFWkeyevent glfw_keyevent = {.key = key, .native_key = [event keyCode], .action = action, .mods = mods};
|
||||
GLFWkeyevent glfw_keyevent = {.key = key, .native_key = [event keyCode], .native_key_id = [event keyCode], .action = action, .mods = mods};
|
||||
_glfwInputKeyboard(window, &glfw_keyevent);
|
||||
}
|
||||
|
||||
@@ -1339,7 +1367,7 @@ is_ascii_control_char(char x) {
|
||||
const uint32_t key = translateKey(keycode, true);
|
||||
const int mods = translateFlags([event modifierFlags]);
|
||||
|
||||
GLFWkeyevent glfw_keyevent = {.key = key, .native_key = keycode, .action = GLFW_RELEASE, .mods = mods};
|
||||
GLFWkeyevent glfw_keyevent = {.key = key, .native_key = keycode, .native_key_id = keycode, .action = GLFW_RELEASE, .mods = mods};
|
||||
add_alternate_keys(&glfw_keyevent, event);
|
||||
debug_key("\x1b[32mRelease:\x1b[m native_key: 0x%x (%s) glfw_key: 0x%x %s\n",
|
||||
keycode, safe_name_for_keycode(keycode), key, format_mods(mods));
|
||||
@@ -1444,12 +1472,17 @@ is_ascii_control_char(char x) {
|
||||
selectedRange:(NSRange)selectedRange
|
||||
replacementRange:(NSRange)replacementRange
|
||||
{
|
||||
(void)selectedRange; (void)replacementRange;
|
||||
[markedText release];
|
||||
if ([string isKindOfClass:[NSAttributedString class]])
|
||||
debug_key("\n\tsetMarkedText: %s selectedRange: (%lu, %lu) replacementRange: (%lu, %lu)\n", polymorphic_string_as_utf8(string), selectedRange.location, selectedRange.length, replacementRange.location, replacementRange.length);
|
||||
if (string == nil) { [self unmarkText]; return; }
|
||||
if ([string isKindOfClass:[NSAttributedString class]]) {
|
||||
if (((NSMutableAttributedString*)string).length == 0) { [self unmarkText]; return; }
|
||||
[markedText release];
|
||||
markedText = [[NSMutableAttributedString alloc] initWithAttributedString:string];
|
||||
else
|
||||
} else {
|
||||
if (((NSString*)string).length == 0) { [self unmarkText]; return; }
|
||||
[markedText release];
|
||||
markedText = [[NSMutableAttributedString alloc] initWithString:string];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)unmarkText
|
||||
@@ -1467,17 +1500,18 @@ void _glfwPlatformUpdateIMEState(_GLFWwindow *w, const GLFWIMEUpdateEvent *ev) {
|
||||
cellWidth:(CGFloat)cellWidth
|
||||
cellHeight:(CGFloat)cellHeight
|
||||
{
|
||||
(void) which;
|
||||
if (which != GLFW_IME_UPDATE_CURSOR_POSITION) return;
|
||||
left /= window->ns.xscale;
|
||||
top /= window->ns.yscale;
|
||||
cellWidth /= window->ns.xscale;
|
||||
cellHeight /= window->ns.yscale;
|
||||
debug_key("updateIMEState: %f, %f, %f, %f\n", left, top, cellWidth, cellHeight);
|
||||
debug_key("updateIMEPosition: left=%f, top=%f, width=%f, height=%f\n", left, top, cellWidth, cellHeight);
|
||||
const NSRect frame = [window->ns.view frame];
|
||||
const NSRect rectInView = NSMakeRect(left,
|
||||
frame.size.height - top - cellHeight,
|
||||
cellWidth, cellHeight);
|
||||
markedRect = [window->ns.object convertRectToScreen: rectInView];
|
||||
if (_glfwPlatformWindowFocused(window)) [[window->ns.view inputContext] invalidateCharacterCoordinates];
|
||||
}
|
||||
|
||||
- (NSArray*)validAttributesForMarkedText
|
||||
@@ -1507,21 +1541,21 @@ void _glfwPlatformUpdateIMEState(_GLFWwindow *w, const GLFWIMEUpdateEvent *ev) {
|
||||
|
||||
- (void)insertText:(id)string replacementRange:(NSRange)replacementRange
|
||||
{
|
||||
(void)replacementRange;
|
||||
NSString* characters;
|
||||
if ([string isKindOfClass:[NSAttributedString class]])
|
||||
characters = [string string];
|
||||
else
|
||||
characters = (NSString*) string;
|
||||
const char *utf8 = polymorphic_string_as_utf8(string);
|
||||
debug_key("\n\tinsertText: %s replacementRange: (%lu, %lu)\n", utf8, replacementRange.location, replacementRange.length);
|
||||
if ([self hasMarkedText]) {
|
||||
[self unmarkText];
|
||||
marked_text_cleared_by_insert = true;
|
||||
}
|
||||
// insertText can be called multiple times for a single key event
|
||||
char *s = _glfw.ns.text + strnlen(_glfw.ns.text, sizeof(_glfw.ns.text));
|
||||
snprintf(s, sizeof(_glfw.ns.text) - (s - _glfw.ns.text), "%s", [characters UTF8String]);
|
||||
snprintf(s, sizeof(_glfw.ns.text) - (s - _glfw.ns.text), "%s", utf8);
|
||||
_glfw.ns.text[sizeof(_glfw.ns.text) - 1] = 0;
|
||||
}
|
||||
|
||||
- (void)doCommandBySelector:(SEL)selector
|
||||
{
|
||||
(void)selector;
|
||||
debug_key("\n\tdoCommandBySelector: (%s)\n", [NSStringFromSelector(selector) UTF8String]);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1605,7 +1639,14 @@ void _glfwPlatformUpdateIMEState(_GLFWwindow *w, const GLFWIMEUpdateEvent *ev) {
|
||||
{
|
||||
if (glfw_window && glfw_window->ns.toggleFullscreenCallback && glfw_window->ns.toggleFullscreenCallback((GLFWwindow*)glfw_window) == 1)
|
||||
return;
|
||||
// When resizeIncrements is set, Cocoa cannot restore the original window size after returning from fullscreen.
|
||||
const NSSize original = [self resizeIncrements];
|
||||
[self setResizeIncrements:NSMakeSize(1.0, 1.0)];
|
||||
[super toggleFullScreen:sender];
|
||||
[self setResizeIncrements:original];
|
||||
// When the window decoration is hidden, toggling fullscreen causes the style mask to be changed,
|
||||
// and causes the first responder to be cleared.
|
||||
if (glfw_window && !glfw_window->decorated && glfw_window->ns.view) [self makeFirstResponder:glfw_window->ns.view];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1809,8 +1850,7 @@ void _glfwPlatformSetWindowIcon(_GLFWwindow* window UNUSED,
|
||||
|
||||
void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
|
||||
{
|
||||
const NSRect contentRect =
|
||||
[window->ns.object contentRectForFrameRect:[window->ns.object frame]];
|
||||
const NSRect contentRect = get_window_size_without_border_in_logical_pixels(window);
|
||||
|
||||
if (xpos)
|
||||
*xpos = (int)contentRect.origin.x;
|
||||
@@ -1820,7 +1860,7 @@ void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
|
||||
|
||||
void _glfwPlatformSetWindowPos(_GLFWwindow* window, int x, int y)
|
||||
{
|
||||
const NSRect contentRect = [window->ns.view frame];
|
||||
const NSRect contentRect = get_window_size_without_border_in_logical_pixels(window);
|
||||
const NSRect dummyRect = NSMakeRect(x, _glfwTransformYNS(y + contentRect.size.height - 1), 0, 0);
|
||||
const NSRect frameRect = [window->ns.object frameRectForContentRect:dummyRect];
|
||||
[window->ns.object setFrameOrigin:frameRect.origin];
|
||||
@@ -1828,7 +1868,7 @@ void _glfwPlatformSetWindowPos(_GLFWwindow* window, int x, int y)
|
||||
|
||||
void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)
|
||||
{
|
||||
const NSRect contentRect = [window->ns.view frame];
|
||||
const NSRect contentRect = get_window_size_without_border_in_logical_pixels(window);
|
||||
|
||||
if (width)
|
||||
*width = (int)contentRect.size.width;
|
||||
@@ -1845,8 +1885,9 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
|
||||
}
|
||||
else
|
||||
{
|
||||
NSRect contentRect =
|
||||
[window->ns.object contentRectForFrameRect:[window->ns.object frame]];
|
||||
// Disable window resizing in fullscreen.
|
||||
if ([window->ns.object styleMask] & NSWindowStyleMaskFullScreen || window->ns.in_traditional_fullscreen) return;
|
||||
NSRect contentRect = get_window_size_without_border_in_logical_pixels(window);
|
||||
contentRect.origin.y += contentRect.size.height - height;
|
||||
contentRect.size = NSMakeSize(width, height);
|
||||
[window->ns.object setFrame:[window->ns.object frameRectForContentRect:contentRect]
|
||||
@@ -1879,15 +1920,18 @@ void _glfwPlatformSetWindowAspectRatio(_GLFWwindow* window, int numer, int denom
|
||||
|
||||
void _glfwPlatformSetWindowSizeIncrements(_GLFWwindow* window, int widthincr, int heightincr)
|
||||
{
|
||||
if (widthincr != GLFW_DONT_CARE && heightincr != GLFW_DONT_CARE)
|
||||
[window->ns.object setResizeIncrements:NSMakeSize(widthincr, heightincr)];
|
||||
else
|
||||
if (widthincr != GLFW_DONT_CARE && heightincr != GLFW_DONT_CARE) {
|
||||
float xscale = 1, yscale = 1;
|
||||
_glfwPlatformGetWindowContentScale(window, &xscale, &yscale);
|
||||
[window->ns.object setResizeIncrements:NSMakeSize(widthincr / xscale, heightincr / yscale)];
|
||||
} else {
|
||||
[window->ns.object setResizeIncrements:NSMakeSize(1.0, 1.0)];
|
||||
}
|
||||
}
|
||||
|
||||
void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height)
|
||||
{
|
||||
const NSRect contentRect = [window->ns.view frame];
|
||||
const NSRect contentRect = get_window_size_without_border_in_logical_pixels(window);
|
||||
const NSRect fbRect = [window->ns.view convertRectToBacking:contentRect];
|
||||
|
||||
if (width)
|
||||
@@ -1900,7 +1944,7 @@ void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window,
|
||||
int* left, int* top,
|
||||
int* right, int* bottom)
|
||||
{
|
||||
const NSRect contentRect = [window->ns.view frame];
|
||||
const NSRect contentRect = get_window_size_without_border_in_logical_pixels(window);
|
||||
const NSRect frameRect = [window->ns.object frameRectForContentRect:contentRect];
|
||||
|
||||
if (left)
|
||||
@@ -1918,7 +1962,7 @@ void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window,
|
||||
void _glfwPlatformGetWindowContentScale(_GLFWwindow* window,
|
||||
float* xscale, float* yscale)
|
||||
{
|
||||
const NSRect points = [window->ns.view frame];
|
||||
const NSRect points = get_window_size_without_border_in_logical_pixels(window);
|
||||
const NSRect pixels = [window->ns.view convertRectToBacking:points];
|
||||
|
||||
if (xscale)
|
||||
@@ -2402,13 +2446,21 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor UNUSED)
|
||||
updateCursorImage(window);
|
||||
}
|
||||
|
||||
bool _glfwPlatformIsFullscreen(_GLFWwindow* w, unsigned int flags) {
|
||||
NSWindow *window = w->ns.object;
|
||||
bool traditional = !(flags & 1);
|
||||
if (traditional) { if(@available(macOS 11.0, *)) return w->ns.in_traditional_fullscreen; }
|
||||
NSWindowStyleMask sm = [window styleMask];
|
||||
return sm & NSWindowStyleMaskFullScreen;
|
||||
}
|
||||
|
||||
bool _glfwPlatformToggleFullscreen(_GLFWwindow* w, unsigned int flags) {
|
||||
NSWindow *window = w->ns.object;
|
||||
bool made_fullscreen = true;
|
||||
bool traditional = !(flags & 1);
|
||||
NSWindowStyleMask sm = [window styleMask];
|
||||
if (traditional) {
|
||||
if (@available(macOS 10.16, *)) {
|
||||
if (@available(macOS 11.0, *)) {
|
||||
// As of Big Turd NSWindowStyleMaskFullScreen is no longer useable
|
||||
if (!w->ns.in_traditional_fullscreen) {
|
||||
w->ns.pre_full_screen_style_mask = sm;
|
||||
@@ -2422,9 +2474,6 @@ bool _glfwPlatformToggleFullscreen(_GLFWwindow* w, unsigned int flags) {
|
||||
[[NSApplication sharedApplication] setPresentationOptions: NSApplicationPresentationDefault];
|
||||
w->ns.in_traditional_fullscreen = false;
|
||||
}
|
||||
// for some reason despite calling this selector, the window doesnt actually get keyboard focus till you click on it.
|
||||
// presumably a bug with NSWindowStyleMaskBorderless windows
|
||||
[window performSelector:@selector(makeKeyAndOrderFront:) withObject:nil afterDelay:0];
|
||||
} else {
|
||||
bool in_fullscreen = sm & NSWindowStyleMaskFullScreen;
|
||||
if (!(in_fullscreen)) {
|
||||
@@ -2437,6 +2486,12 @@ bool _glfwPlatformToggleFullscreen(_GLFWwindow* w, unsigned int flags) {
|
||||
}
|
||||
[window setStyleMask: sm];
|
||||
}
|
||||
// Changing the style mask causes the first responder to be cleared
|
||||
[window makeFirstResponder:w->ns.view];
|
||||
// If the dock and menubar are hidden going from maximized to fullscreen doesnt change the window size
|
||||
// and macOS forgets to trigger windowDidResize, so call it ourselves
|
||||
NSNotification *notification = [NSNotification notificationWithName:NSWindowDidResizeNotification object:window];
|
||||
[w->ns.delegate performSelector:@selector(windowDidResize:) withObject:notification afterDelay:0];
|
||||
} else {
|
||||
bool in_fullscreen = sm & NSWindowStyleMaskFullScreen;
|
||||
if (in_fullscreen) made_fullscreen = false;
|
||||
|
||||
4
glfw/dbus_glfw.c
vendored
@@ -31,7 +31,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
static inline void
|
||||
static void
|
||||
report_error(DBusError *err, const char *fmt, ...) {
|
||||
static char buf[1024];
|
||||
va_list args;
|
||||
@@ -64,7 +64,7 @@ on_dbus_watch_ready(int fd UNUSED, int events, void *data) {
|
||||
dbus_watch_handle(watch, flags);
|
||||
}
|
||||
|
||||
static inline int
|
||||
static int
|
||||
events_for_watch(DBusWatch *watch) {
|
||||
int events = 0;
|
||||
unsigned int flags = dbus_watch_get_flags(watch);
|
||||
|
||||
43
glfw/glfw.py
@@ -6,7 +6,7 @@ import json
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from typing import Callable, Dict, List, Optional, Tuple
|
||||
from typing import Callable, Dict, List, NamedTuple, Optional, Sequence, Tuple
|
||||
|
||||
_plat = sys.platform.lower()
|
||||
is_linux = 'linux' in _plat
|
||||
@@ -14,9 +14,23 @@ is_openbsd = 'openbsd' in _plat
|
||||
base = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class CompileKey(NamedTuple):
|
||||
src: str
|
||||
dest: str
|
||||
|
||||
|
||||
class Command(NamedTuple):
|
||||
desc: str
|
||||
cmd: Sequence[str]
|
||||
is_newer_func: Callable[[], bool]
|
||||
on_success: Callable[[], None] = lambda: None
|
||||
key: Optional[CompileKey] = None
|
||||
keyfile: Optional[str] = None
|
||||
|
||||
|
||||
class Env:
|
||||
|
||||
cc: str = ''
|
||||
cc: List[str] = []
|
||||
cppflags: List[str] = []
|
||||
cflags: List[str] = []
|
||||
ldflags: List[str] = []
|
||||
@@ -33,11 +47,12 @@ class Env:
|
||||
wayland_protocols: Tuple[str, ...] = ()
|
||||
|
||||
def __init__(
|
||||
self, cc: str = '', cppflags: List[str] = [], cflags: List[str] = [], ldflags: List[str] = [],
|
||||
self, cc: List[str] = [], cppflags: List[str] = [], cflags: List[str] = [], ldflags: List[str] = [],
|
||||
library_paths: Dict[str, List[str]] = {}, ldpaths: Optional[List[str]] = None, ccver: Tuple[int, int] = (0, 0)
|
||||
):
|
||||
self.cc, self.cppflags, self.cflags, self.ldflags, self.library_paths = cc, cppflags, cflags, ldflags, library_paths
|
||||
self.ldpaths, self.ccver = [] if ldpaths is None else ldpaths, ccver
|
||||
self.ldpaths = ldpaths or []
|
||||
self.ccver = ccver
|
||||
|
||||
def copy(self) -> 'Env':
|
||||
ans = Env(self.cc, list(self.cppflags), list(self.cflags), list(self.ldflags), dict(self.library_paths), list(self.ldpaths), self.ccver)
|
||||
@@ -55,7 +70,14 @@ def wayland_protocol_file_name(base: str, ext: str = 'c') -> str:
|
||||
return 'wayland-{}-client-protocol.{}'.format(base, ext)
|
||||
|
||||
|
||||
def init_env(env: Env, pkg_config: Callable, pkg_version: Callable, at_least_version: Callable, test_compile: Callable, module: str = 'x11') -> Env:
|
||||
def init_env(
|
||||
env: Env,
|
||||
pkg_config: Callable[..., List[str]],
|
||||
pkg_version: Callable[[str], Tuple[int, int]],
|
||||
at_least_version: Callable[..., None],
|
||||
test_compile: Callable[..., bool],
|
||||
module: str = 'x11'
|
||||
) -> Env:
|
||||
ans = env.copy()
|
||||
ans.cflags.append('-fPIC')
|
||||
ans.cppflags.append('-D_GLFW_' + module.upper())
|
||||
@@ -117,7 +139,13 @@ def init_env(env: Env, pkg_config: Callable, pkg_version: Callable, at_least_ver
|
||||
return ans
|
||||
|
||||
|
||||
def build_wayland_protocols(env: Env, Command: Callable, parallel_run: Callable, emphasis: Callable, newer: Callable, dest_dir: str) -> None:
|
||||
def build_wayland_protocols(
|
||||
env: Env,
|
||||
parallel_run: Callable[[List[Command]], None],
|
||||
emphasis: Callable[[str], str],
|
||||
newer: Callable[..., bool],
|
||||
dest_dir: str
|
||||
) -> None:
|
||||
items = []
|
||||
for protocol in env.wayland_protocols:
|
||||
src = os.path.join(env.wayland_packagedir, protocol)
|
||||
@@ -130,8 +158,7 @@ def build_wayland_protocols(env: Env, Command: Callable, parallel_run: Callable,
|
||||
q = 'client-header' if ext == 'h' else env.wayland_scanner_code
|
||||
items.append(Command(
|
||||
'Generating {} ...'.format(emphasis(os.path.basename(dest))),
|
||||
[env.wayland_scanner, q, src, dest],
|
||||
lambda: True, None, None, None))
|
||||
[env.wayland_scanner, q, src, dest], lambda: True))
|
||||
if items:
|
||||
parallel_run(items)
|
||||
|
||||
|
||||
5
glfw/glfw3.h
vendored
@@ -1245,6 +1245,10 @@ typedef struct GLFWkeyevent
|
||||
// A value of GLFW_IME_PREEDIT_CHANGED means the pre-edit text for the input event has been changed.
|
||||
// A value of GLFW_IME_COMMIT_TEXT means the text should be committed.
|
||||
GLFWIMEState ime_state;
|
||||
|
||||
// For internal use only. On Linux it is the actual keycode reported by the windowing system, in contrast
|
||||
// to native_key which can be the result of a compose operation. On macOS it is the same as native_key.
|
||||
uint32_t native_key_id;
|
||||
} GLFWkeyevent;
|
||||
|
||||
/*! @brief The function pointer type for error callbacks.
|
||||
@@ -2752,6 +2756,7 @@ GLFWAPI void glfwWindowHintString(int hint, const char* value);
|
||||
*/
|
||||
GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share);
|
||||
GLFWAPI bool glfwToggleFullscreen(GLFWwindow *window, unsigned int flags);
|
||||
GLFWAPI bool glfwIsFullscreen(GLFWwindow *window, unsigned int flags);
|
||||
|
||||
/*! @brief Destroys the specified window and its context.
|
||||
*
|
||||
|
||||
26
glfw/glx_context.c
vendored
@@ -48,7 +48,7 @@ static int getGLXFBConfigAttrib(GLXFBConfig fbconfig, int attrib)
|
||||
}
|
||||
|
||||
static GLXFBConfig*
|
||||
choose_fb_config(const _GLFWfbconfig* desired, bool trust_window_bit, int *nelements) {
|
||||
choose_fb_config(const _GLFWfbconfig* desired, bool trust_window_bit, int *nelements, bool use_best_color_depth) {
|
||||
int attrib_list[64];
|
||||
int pos = 0;
|
||||
#define ATTR(x, y) { attrib_list[pos++] = x; attrib_list[pos++] = y; }
|
||||
@@ -59,10 +59,16 @@ choose_fb_config(const _GLFWfbconfig* desired, bool trust_window_bit, int *nelem
|
||||
if (_glfw.glx.ARB_multisample && desired->samples > 0) ATTR(GLX_SAMPLES, desired->samples);
|
||||
if (desired->depthBits != GLFW_DONT_CARE) ATTR(GLX_DEPTH_SIZE, desired->depthBits);
|
||||
if (desired->stencilBits != GLFW_DONT_CARE) ATTR(GLX_STENCIL_SIZE, desired->stencilBits);
|
||||
if (desired->redBits != GLFW_DONT_CARE) ATTR(GLX_RED_SIZE, desired->redBits);
|
||||
if (desired->greenBits != GLFW_DONT_CARE) ATTR(GLX_GREEN_SIZE, desired->greenBits);
|
||||
if (desired->blueBits != GLFW_DONT_CARE) ATTR(GLX_BLUE_SIZE, desired->blueBits);
|
||||
if (desired->alphaBits != GLFW_DONT_CARE) ATTR(GLX_ALPHA_SIZE, desired->alphaBits);
|
||||
if (use_best_color_depth) {
|
||||
// we just ask for the highest available R+G+B+A color depth. This hopefully
|
||||
// works with 10bit (r=10, g=10, b=19, a=2) visuals
|
||||
ATTR(GLX_RED_SIZE, 1); ATTR(GLX_GREEN_SIZE, 1); ATTR(GLX_BLUE_SIZE, 1); ATTR(GLX_ALPHA_SIZE, 1);
|
||||
} else {
|
||||
if (desired->redBits != GLFW_DONT_CARE) ATTR(GLX_RED_SIZE, desired->redBits);
|
||||
if (desired->greenBits != GLFW_DONT_CARE) ATTR(GLX_GREEN_SIZE, desired->greenBits);
|
||||
if (desired->blueBits != GLFW_DONT_CARE) ATTR(GLX_BLUE_SIZE, desired->blueBits);
|
||||
if (desired->alphaBits != GLFW_DONT_CARE) ATTR(GLX_ALPHA_SIZE, desired->alphaBits);
|
||||
}
|
||||
if (desired->accumRedBits != GLFW_DONT_CARE) ATTR(GLX_ACCUM_RED_SIZE, desired->accumRedBits);
|
||||
if (desired->accumGreenBits != GLFW_DONT_CARE) ATTR(GLX_ACCUM_GREEN_SIZE, desired->accumGreenBits);
|
||||
if (desired->accumBlueBits != GLFW_DONT_CARE) ATTR(GLX_ACCUM_BLUE_SIZE, desired->accumBlueBits);
|
||||
@@ -96,11 +102,15 @@ static bool chooseGLXFBConfig(const _GLFWfbconfig* desired,
|
||||
vendor = glXGetClientString(_glfw.x11.display, GLX_VENDOR);
|
||||
if (vendor && strcmp(vendor, "Chromium") == 0)
|
||||
trustWindowBit = false;
|
||||
nativeConfigs = choose_fb_config(desired, trustWindowBit, &nativeCount);
|
||||
nativeConfigs = choose_fb_config(desired, trustWindowBit, &nativeCount, false);
|
||||
if (!nativeConfigs || !nativeCount)
|
||||
{
|
||||
_glfwInputError(GLFW_API_UNAVAILABLE, "GLX: No GLXFBConfigs returned");
|
||||
return false;
|
||||
nativeConfigs = choose_fb_config(desired, trustWindowBit, &nativeCount, true);
|
||||
|
||||
if (!nativeConfigs || !nativeCount) {
|
||||
_glfwInputError(GLFW_API_UNAVAILABLE, "GLX: No GLXFBConfigs returned");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < nativeCount; i++)
|
||||
{
|
||||
|
||||
196
glfw/ibus_glfw.c
vendored
@@ -49,14 +49,78 @@ enum Capabilities {
|
||||
IBUS_CAP_SURROUNDING_TEXT = 1 << 5
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
IBUS_SHIFT_MASK = 1 << 0,
|
||||
IBUS_LOCK_MASK = 1 << 1,
|
||||
IBUS_CONTROL_MASK = 1 << 2,
|
||||
IBUS_MOD1_MASK = 1 << 3,
|
||||
IBUS_MOD2_MASK = 1 << 4,
|
||||
IBUS_MOD3_MASK = 1 << 5,
|
||||
IBUS_MOD4_MASK = 1 << 6,
|
||||
IBUS_MOD5_MASK = 1 << 7,
|
||||
IBUS_BUTTON1_MASK = 1 << 8,
|
||||
IBUS_BUTTON2_MASK = 1 << 9,
|
||||
IBUS_BUTTON3_MASK = 1 << 10,
|
||||
IBUS_BUTTON4_MASK = 1 << 11,
|
||||
IBUS_BUTTON5_MASK = 1 << 12,
|
||||
|
||||
static inline bool
|
||||
/* The next few modifiers are used by XKB, so we skip to the end.
|
||||
* Bits 15 - 23 are currently unused. Bit 29 is used internally.
|
||||
*/
|
||||
|
||||
/* ibus mask */
|
||||
IBUS_HANDLED_MASK = 1 << 24,
|
||||
IBUS_FORWARD_MASK = 1 << 25,
|
||||
IBUS_IGNORED_MASK = IBUS_FORWARD_MASK,
|
||||
|
||||
IBUS_SUPER_MASK = 1 << 26,
|
||||
IBUS_HYPER_MASK = 1 << 27,
|
||||
IBUS_META_MASK = 1 << 28,
|
||||
|
||||
IBUS_RELEASE_MASK = 1 << 30,
|
||||
|
||||
IBUS_MODIFIER_MASK = 0x5f001fff
|
||||
} IBusModifierType;
|
||||
|
||||
|
||||
static uint32_t
|
||||
ibus_key_state_from_glfw(unsigned int glfw_modifiers, int action) {
|
||||
uint32_t ans = action == GLFW_RELEASE ? IBUS_RELEASE_MASK : 0;
|
||||
#define M(g, i) if(glfw_modifiers & GLFW_MOD_##g) ans |= i
|
||||
M(SHIFT, IBUS_SHIFT_MASK);
|
||||
M(CAPS_LOCK, IBUS_LOCK_MASK);
|
||||
M(CONTROL, IBUS_CONTROL_MASK);
|
||||
M(ALT, IBUS_MOD1_MASK);
|
||||
M(NUM_LOCK, IBUS_MOD2_MASK);
|
||||
M(SUPER, IBUS_MOD4_MASK);
|
||||
/* To do: figure out how to get super/hyper/meta */
|
||||
#undef M
|
||||
return ans;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
glfw_modifiers_from_ibus_state(uint32_t ibus_key_state) {
|
||||
unsigned int ans = 0;
|
||||
#define M(g, i) if(ibus_key_state & i) ans |= GLFW_MOD_##g
|
||||
M(SHIFT, IBUS_SHIFT_MASK);
|
||||
M(CAPS_LOCK, IBUS_LOCK_MASK);
|
||||
M(CONTROL, IBUS_CONTROL_MASK);
|
||||
M(ALT, IBUS_MOD1_MASK);
|
||||
M(NUM_LOCK, IBUS_MOD2_MASK);
|
||||
M(SUPER, IBUS_MOD4_MASK);
|
||||
/* To do: figure out how to get super/hyper/meta */
|
||||
#undef M
|
||||
return ans;
|
||||
}
|
||||
|
||||
static bool
|
||||
test_env_var(const char *name, const char *val) {
|
||||
const char *q = getenv(name);
|
||||
return (q && strcmp(q, val) == 0) ? true : false;
|
||||
}
|
||||
|
||||
static inline size_t
|
||||
static size_t
|
||||
GLFW_MIN(size_t a, size_t b) {
|
||||
return a < b ? a : b;
|
||||
}
|
||||
@@ -106,7 +170,30 @@ get_ibus_text_from_message(DBusMessage *msg) {
|
||||
return text;
|
||||
}
|
||||
|
||||
static inline void
|
||||
static void
|
||||
handle_ibus_forward_key_event(DBusMessage *msg) {
|
||||
uint32_t keysym, keycode, state;
|
||||
DBusMessageIter iter;
|
||||
dbus_message_iter_init(msg, &iter);
|
||||
|
||||
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32) return;
|
||||
dbus_message_iter_get_basic(&iter, &keysym);
|
||||
dbus_message_iter_next(&iter);
|
||||
|
||||
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32) return;
|
||||
dbus_message_iter_get_basic(&iter, &keycode);
|
||||
dbus_message_iter_next(&iter);
|
||||
|
||||
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32) return;
|
||||
dbus_message_iter_get_basic(&iter, &state);
|
||||
|
||||
int mods = glfw_modifiers_from_ibus_state(state);
|
||||
|
||||
debug("IBUS: ForwardKeyEvent: keysym=%x, keycode=%x, state=%x, glfw_mods=%x\n", keysym, keycode, state, mods);
|
||||
glfw_xkb_forwarded_key_from_ime(keysym, mods);
|
||||
}
|
||||
|
||||
static void
|
||||
send_text(const char *text, GLFWIMEState ime_state) {
|
||||
_GLFWwindow *w = _glfwFocusedWindow();
|
||||
if (w && w->callbacks.keyboard) {
|
||||
@@ -126,7 +213,7 @@ message_handler(DBusConnection *conn UNUSED, DBusMessage *msg, void *user_data)
|
||||
_GLFWIBUSData *ibus = (_GLFWIBUSData*)user_data;
|
||||
(void)ibus;
|
||||
const char *text;
|
||||
switch(glfw_dbus_match_signal(msg, IBUS_INPUT_INTERFACE, "CommitText", "UpdatePreeditText", "HidePreeditText", "ShowPreeditText", NULL)) {
|
||||
switch(glfw_dbus_match_signal(msg, IBUS_INPUT_INTERFACE, "CommitText", "UpdatePreeditText", "HidePreeditText", "ShowPreeditText", "ForwardKeyEvent", NULL)) {
|
||||
case 0:
|
||||
text = get_ibus_text_from_message(msg);
|
||||
debug("IBUS: CommitText: '%s'\n", text ? text : "(nil)");
|
||||
@@ -134,8 +221,8 @@ message_handler(DBusConnection *conn UNUSED, DBusMessage *msg, void *user_data)
|
||||
break;
|
||||
case 1:
|
||||
text = get_ibus_text_from_message(msg);
|
||||
send_text(text, GLFW_IME_PREEDIT_CHANGED);
|
||||
debug("IBUS: UpdatePreeditText: '%s'\n", text ? text : "(nil)");
|
||||
send_text(text, GLFW_IME_PREEDIT_CHANGED);
|
||||
break;
|
||||
case 2:
|
||||
debug("IBUS: HidePreeditText\n");
|
||||
@@ -143,11 +230,44 @@ message_handler(DBusConnection *conn UNUSED, DBusMessage *msg, void *user_data)
|
||||
case 3:
|
||||
debug("IBUS: ShowPreeditText\n");
|
||||
break;
|
||||
case 4:
|
||||
handle_ibus_forward_key_event(msg);
|
||||
break;
|
||||
}
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
|
||||
static inline const char*
|
||||
static DBusHandlerResult
|
||||
ibus_on_owner_change(DBusConnection* conn UNUSED, DBusMessage* msg, void* user_data) {
|
||||
if (dbus_message_is_signal(msg, "org.freedesktop.DBus", "NameOwnerChanged")) {
|
||||
const char* name;
|
||||
const char* old_owner;
|
||||
const char* new_owner;
|
||||
|
||||
if (!dbus_message_get_args(msg, NULL,
|
||||
DBUS_TYPE_STRING, &name,
|
||||
DBUS_TYPE_STRING, &old_owner,
|
||||
DBUS_TYPE_STRING, &new_owner,
|
||||
DBUS_TYPE_INVALID
|
||||
)) {
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
|
||||
if (strcmp(name, "org.freedesktop.IBus") != 0) {
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
|
||||
_GLFWIBUSData* ibus = (_GLFWIBUSData*) user_data;
|
||||
ibus->name_owner_changed = true;
|
||||
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
|
||||
}
|
||||
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
|
||||
static const char*
|
||||
get_ibus_address_file_name(void) {
|
||||
const char *addr;
|
||||
static char ans[PATH_MAX];
|
||||
@@ -196,7 +316,7 @@ get_ibus_address_file_name(void) {
|
||||
}
|
||||
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
read_ibus_address(_GLFWIBUSData *ibus) {
|
||||
static char buf[1024];
|
||||
struct stat s;
|
||||
@@ -243,6 +363,8 @@ input_context_created(DBusMessage *msg, const char* errmsg, void *data) {
|
||||
free((void*)ibus->input_ctx_path);
|
||||
ibus->input_ctx_path = _glfw_strdup(path);
|
||||
if (!ibus->input_ctx_path) return;
|
||||
dbus_bus_add_match(ibus->conn, "type='signal',interface='org.freedesktop.DBus', member='NameOwnerChanged'", NULL);
|
||||
dbus_connection_add_filter(ibus->conn, ibus_on_owner_change, ibus, free);
|
||||
dbus_bus_add_match(ibus->conn, "type='signal',interface='org.freedesktop.IBus.InputContext'", NULL);
|
||||
DBusObjectPathVTable ibus_vtable = {.message_function = message_handler};
|
||||
dbus_connection_try_register_object_path(ibus->conn, ibus->input_ctx_path, &ibus_vtable, ibus, NULL);
|
||||
@@ -285,6 +407,7 @@ glfw_connect_to_ibus(_GLFWIBUSData *ibus) {
|
||||
if (ibus->inited) return;
|
||||
if (!test_env_var("GLFW_IM_MODULE", "ibus")) return;
|
||||
ibus->inited = true;
|
||||
ibus->name_owner_changed = false;
|
||||
setup_connection(ibus);
|
||||
}
|
||||
|
||||
@@ -306,13 +429,12 @@ glfw_ibus_terminate(_GLFWIBUSData *ibus) {
|
||||
static bool
|
||||
check_connection(_GLFWIBUSData *ibus) {
|
||||
if (!ibus->inited) return false;
|
||||
if (ibus->conn && dbus_connection_get_is_connected(ibus->conn)) {
|
||||
return ibus->ok;
|
||||
}
|
||||
if (ibus->conn && dbus_connection_get_is_connected(ibus->conn) && !ibus->name_owner_changed) return ibus->ok;
|
||||
struct stat s;
|
||||
ibus->name_owner_changed = false;
|
||||
if (stat(ibus->address_file_name, &s) != 0 || s.st_mtime != ibus->address_file_mtime) {
|
||||
if (!read_ibus_address(ibus)) return false;
|
||||
setup_connection(ibus);
|
||||
return setup_connection(ibus);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -344,56 +466,6 @@ glfw_ibus_set_cursor_geometry(_GLFWIBUSData *ibus, int x, int y, int w, int h) {
|
||||
}
|
||||
}
|
||||
|
||||
typedef enum
|
||||
{
|
||||
IBUS_SHIFT_MASK = 1 << 0,
|
||||
IBUS_LOCK_MASK = 1 << 1,
|
||||
IBUS_CONTROL_MASK = 1 << 2,
|
||||
IBUS_MOD1_MASK = 1 << 3,
|
||||
IBUS_MOD2_MASK = 1 << 4,
|
||||
IBUS_MOD3_MASK = 1 << 5,
|
||||
IBUS_MOD4_MASK = 1 << 6,
|
||||
IBUS_MOD5_MASK = 1 << 7,
|
||||
IBUS_BUTTON1_MASK = 1 << 8,
|
||||
IBUS_BUTTON2_MASK = 1 << 9,
|
||||
IBUS_BUTTON3_MASK = 1 << 10,
|
||||
IBUS_BUTTON4_MASK = 1 << 11,
|
||||
IBUS_BUTTON5_MASK = 1 << 12,
|
||||
|
||||
/* The next few modifiers are used by XKB, so we skip to the end.
|
||||
* Bits 15 - 23 are currently unused. Bit 29 is used internally.
|
||||
*/
|
||||
|
||||
/* ibus mask */
|
||||
IBUS_HANDLED_MASK = 1 << 24,
|
||||
IBUS_FORWARD_MASK = 1 << 25,
|
||||
IBUS_IGNORED_MASK = IBUS_FORWARD_MASK,
|
||||
|
||||
IBUS_SUPER_MASK = 1 << 26,
|
||||
IBUS_HYPER_MASK = 1 << 27,
|
||||
IBUS_META_MASK = 1 << 28,
|
||||
|
||||
IBUS_RELEASE_MASK = 1 << 30,
|
||||
|
||||
IBUS_MODIFIER_MASK = 0x5f001fff
|
||||
} IBusModifierType;
|
||||
|
||||
|
||||
static inline uint32_t
|
||||
ibus_key_state(unsigned int glfw_modifiers, int action) {
|
||||
uint32_t ans = action == GLFW_RELEASE ? IBUS_RELEASE_MASK : 0;
|
||||
#define M(g, i) if(glfw_modifiers & GLFW_MOD_##g) ans |= i
|
||||
M(SHIFT, IBUS_SHIFT_MASK);
|
||||
M(CAPS_LOCK, IBUS_LOCK_MASK);
|
||||
M(CONTROL, IBUS_CONTROL_MASK);
|
||||
M(ALT, IBUS_MOD1_MASK);
|
||||
M(NUM_LOCK, IBUS_MOD2_MASK);
|
||||
M(SUPER, IBUS_MOD4_MASK);
|
||||
/* To do: figure out how to get super/hyper/meta */
|
||||
#undef M
|
||||
return ans;
|
||||
}
|
||||
|
||||
void
|
||||
key_event_processed(DBusMessage *msg, const char* errmsg, void *data) {
|
||||
uint32_t handled = 0;
|
||||
@@ -422,7 +494,7 @@ ibus_process_key(const _GLFWIBUSKeyEvent *ev_, _GLFWIBUSData *ibus) {
|
||||
// Put the key's text in a field IN the structure, for proper serialization.
|
||||
if (ev->glfw_ev.text) strncpy(ev->__embedded_text, ev->glfw_ev.text, sizeof(ev->__embedded_text) - 1);
|
||||
ev->glfw_ev.text = NULL;
|
||||
uint32_t state = ibus_key_state(ev->glfw_ev.mods, ev->glfw_ev.action);
|
||||
uint32_t state = ibus_key_state_from_glfw(ev->glfw_ev.mods, ev->glfw_ev.action);
|
||||
if (!glfw_dbus_call_method_with_reply(
|
||||
ibus->conn, IBUS_SERVICE, ibus->input_ctx_path, IBUS_INPUT_INTERFACE, "ProcessKeyEvent",
|
||||
3000, key_event_processed, ev,
|
||||
|
||||
2
glfw/ibus_glfw.h
vendored
@@ -32,7 +32,7 @@
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
typedef struct {
|
||||
bool ok, inited;
|
||||
bool ok, inited, name_owner_changed;
|
||||
time_t address_file_mtime;
|
||||
DBusConnection *conn;
|
||||
const char *input_ctx_path, *address_file_name, *address;
|
||||
|
||||
40
glfw/input.c
vendored
@@ -274,11 +274,11 @@ static bool parseMapping(_GLFWmapping* mapping, const char* string)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void
|
||||
set_key_action(_GLFWwindow *window, uint32_t key, int val, int idx) {
|
||||
set_key_action(_GLFWwindow *window, const GLFWkeyevent *ev, int action, int idx) {
|
||||
const unsigned sz = arraysz(window->activated_keys);
|
||||
if (idx < 0) {
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
if (window->activated_keys[i].key == 0) {
|
||||
if (window->activated_keys[i].native_key_id == 0) {
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
@@ -286,18 +286,18 @@ set_key_action(_GLFWwindow *window, uint32_t key, int val, int idx) {
|
||||
if (idx < 0) {
|
||||
idx = sz - 1;
|
||||
memmove(window->activated_keys, window->activated_keys + 1, sizeof(window->activated_keys[0]) * (sz - 1));
|
||||
window->activated_keys[sz - 1].key = key;
|
||||
window->activated_keys[sz - 1].native_key_id = 0;
|
||||
}
|
||||
}
|
||||
if (val == GLFW_RELEASE) {
|
||||
if (action == GLFW_RELEASE) {
|
||||
memset(window->activated_keys + idx, 0, sizeof(window->activated_keys[0]));
|
||||
if (idx < (int)sz - 1) {
|
||||
memmove(window->activated_keys + idx, window->activated_keys + idx + 1, sizeof(window->activated_keys[0]) * (sz - 1 - idx));
|
||||
memset(window->activated_keys + sz - 1, 0, sizeof(window->activated_keys[0]));
|
||||
}
|
||||
} else {
|
||||
window->activated_keys[idx].key = key;
|
||||
window->activated_keys[idx].action = val;
|
||||
window->activated_keys[idx] = *ev;
|
||||
window->activated_keys[idx].text = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,30 +305,39 @@ set_key_action(_GLFWwindow *window, uint32_t key, int val, int idx) {
|
||||
//
|
||||
void _glfwInputKeyboard(_GLFWwindow* window, GLFWkeyevent* ev)
|
||||
{
|
||||
if (ev->key > 0)
|
||||
if (ev->native_key_id > 0)
|
||||
{
|
||||
bool repeated = false;
|
||||
int idx = -1;
|
||||
int current_action = GLFW_RELEASE;
|
||||
const unsigned sz = arraysz(window->activated_keys);
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
if (window->activated_keys[i].key == ev->key) {
|
||||
if (window->activated_keys[i].native_key_id == ev->native_key_id) {
|
||||
idx = i;
|
||||
current_action = window->activated_keys[i].action;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ev->action == GLFW_RELEASE && current_action == GLFW_RELEASE)
|
||||
return;
|
||||
if (ev->action == GLFW_RELEASE) {
|
||||
if (current_action == GLFW_RELEASE) return;
|
||||
if (idx > -1) {
|
||||
const GLFWkeyevent *press_event = window->activated_keys + idx;
|
||||
if (press_event->action == GLFW_PRESS || press_event->action == GLFW_REPEAT) {
|
||||
// Compose sequences under X11 give a different key value for press and release events
|
||||
// but we want the same key value so override it.
|
||||
ev->native_key = press_event->native_key;
|
||||
ev->key = press_event->key;
|
||||
ev->shifted_key = press_event->shifted_key;
|
||||
ev->alternate_key = press_event->alternate_key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ev->action == GLFW_PRESS && current_action == GLFW_PRESS)
|
||||
repeated = true;
|
||||
|
||||
if (ev->action == GLFW_RELEASE && window->stickyKeys)
|
||||
set_key_action(window, ev->key, _GLFW_STICK, idx);
|
||||
else
|
||||
set_key_action(window, ev->key, ev->action, idx);
|
||||
set_key_action(window, ev, (ev->action == GLFW_RELEASE && window->stickyKeys) ? _GLFW_STICK : ev->action, idx);
|
||||
|
||||
if (repeated)
|
||||
ev->action = GLFW_REPEAT;
|
||||
@@ -823,7 +832,8 @@ GLFWAPI GLFWKeyAction glfwGetKey(GLFWwindow* handle, uint32_t key)
|
||||
if (current_action == _GLFW_STICK)
|
||||
{
|
||||
// Sticky mode: release key now
|
||||
set_key_action(window, key, GLFW_RELEASE, idx);
|
||||
GLFWkeyevent ev = {0};
|
||||
set_key_action(window, &ev, GLFW_RELEASE, idx);
|
||||
current_action = GLFW_PRESS;
|
||||
}
|
||||
|
||||
|
||||
8
glfw/internal.h
vendored
@@ -402,11 +402,6 @@ struct _GLFWcontext
|
||||
_GLFWcontextOSMesa osmesa;
|
||||
};
|
||||
|
||||
typedef struct GLFWKeyState {
|
||||
uint32_t key;
|
||||
char action;
|
||||
} GLFWKeyState;
|
||||
|
||||
// Window and context structure
|
||||
//
|
||||
struct _GLFWwindow
|
||||
@@ -437,7 +432,7 @@ struct _GLFWwindow
|
||||
bool lockKeyMods;
|
||||
int cursorMode;
|
||||
char mouseButtons[GLFW_MOUSE_BUTTON_LAST + 1];
|
||||
GLFWKeyState activated_keys[16];
|
||||
GLFWkeyevent activated_keys[16];
|
||||
// Virtual cursor position when cursor is disabled
|
||||
double virtualCursorPosX, virtualCursorPosY;
|
||||
bool rawMouseMotion;
|
||||
@@ -717,6 +712,7 @@ void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, _GLFWmonitor* monitor,
|
||||
int xpos, int ypos, int width, int height,
|
||||
int refreshRate);
|
||||
bool _glfwPlatformToggleFullscreen(_GLFWwindow *w, unsigned int flags);
|
||||
bool _glfwPlatformIsFullscreen(_GLFWwindow *w, unsigned int flags);
|
||||
int _glfwPlatformWindowFocused(_GLFWwindow* window);
|
||||
int _glfwPlatformWindowOccluded(_GLFWwindow* window);
|
||||
int _glfwPlatformWindowIconified(_GLFWwindow* window);
|
||||
|
||||
12
glfw/linux_notify.c
vendored
@@ -35,10 +35,10 @@ notification_created(DBusMessage *msg, const char* errmsg, void *data) {
|
||||
if (data) free(data);
|
||||
return;
|
||||
}
|
||||
uint32_t notification_id;
|
||||
if (!glfw_dbus_get_args(msg, "Failed to get Notification uid", DBUS_TYPE_UINT32, ¬ification_id, DBUS_TYPE_INVALID)) return;
|
||||
uint32_t id;
|
||||
if (!glfw_dbus_get_args(msg, "Failed to get Notification uid", DBUS_TYPE_UINT32, &id, DBUS_TYPE_INVALID)) return;
|
||||
NotificationCreatedData *ncd = (NotificationCreatedData*)data;
|
||||
if (ncd->callback) ncd->callback(ncd->next_id, notification_id, ncd->data);
|
||||
if (ncd->callback) ncd->callback(ncd->next_id, id, ncd->data);
|
||||
if (data) free(data);
|
||||
}
|
||||
|
||||
@@ -46,12 +46,12 @@ static DBusHandlerResult
|
||||
message_handler(DBusConnection *conn UNUSED, DBusMessage *msg, void *user_data UNUSED) {
|
||||
/* printf("session_bus message_handler invoked interface: %s member: %s\n", dbus_message_get_interface(msg), dbus_message_get_member(msg)); */
|
||||
if (dbus_message_is_signal(msg, NOTIFICATIONS_IFACE, "ActionInvoked")) {
|
||||
uint32_t notification_id;
|
||||
uint32_t id;
|
||||
const char *action;
|
||||
if (glfw_dbus_get_args(msg, "Failed to get args from ActionInvoked notification signal",
|
||||
DBUS_TYPE_UINT32, ¬ification_id, DBUS_TYPE_STRING, &action, DBUS_TYPE_INVALID)) {
|
||||
DBUS_TYPE_UINT32, &id, DBUS_TYPE_STRING, &action, DBUS_TYPE_INVALID)) {
|
||||
if (activated_handler) {
|
||||
activated_handler(notification_id, action);
|
||||
activated_handler(id, action);
|
||||
return DBUS_HANDLER_RESULT_HANDLED;
|
||||
}
|
||||
}
|
||||
|
||||
4
glfw/window.c
vendored
@@ -1058,6 +1058,10 @@ GLFWAPI bool glfwToggleFullscreen(GLFWwindow* wh, unsigned int flags) {
|
||||
return false;
|
||||
}
|
||||
|
||||
GLFWAPI bool glfwIsFullscreen(GLFWwindow* wh, unsigned int flags) {
|
||||
return _glfwPlatformIsFullscreen((_GLFWwindow*)wh, flags);
|
||||
}
|
||||
|
||||
GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* handle, void* pointer)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
|
||||
2
glfw/wl_init.c
vendored
@@ -54,7 +54,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
static inline int min(int n1, int n2)
|
||||
static int min(int n1, int n2)
|
||||
{
|
||||
return n1 < n2 ? n1 : n2;
|
||||
}
|
||||
|
||||
2
glfw/wl_platform.h
vendored
@@ -230,7 +230,7 @@ typedef struct _GLFWWaylandDataOffer
|
||||
size_t idx;
|
||||
bool is_self_offer;
|
||||
bool is_primary;
|
||||
const char *plain_text_mime, *mime_for_drop;
|
||||
const char *mime_for_drop;
|
||||
uint32_t source_actions;
|
||||
uint32_t dnd_action;
|
||||
struct wl_surface *surface;
|
||||
|
||||
24
glfw/wl_text_input.c
vendored
@@ -25,25 +25,25 @@ static void commit(void) {
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_enter(void *data UNUSED, struct zwp_text_input_v3 *text_input UNUSED, struct wl_surface *surface UNUSED) {
|
||||
text_input_enter(void *data UNUSED, struct zwp_text_input_v3 *txt_input, struct wl_surface *surface UNUSED) {
|
||||
debug("text-input: enter event\n");
|
||||
if (text_input) {
|
||||
zwp_text_input_v3_enable(text_input);
|
||||
zwp_text_input_v3_set_content_type(text_input, ZWP_TEXT_INPUT_V3_CONTENT_HINT_NONE, ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_TERMINAL);
|
||||
if (txt_input) {
|
||||
zwp_text_input_v3_enable(txt_input);
|
||||
zwp_text_input_v3_set_content_type(txt_input, ZWP_TEXT_INPUT_V3_CONTENT_HINT_NONE, ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_TERMINAL);
|
||||
commit();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_leave(void *data UNUSED, struct zwp_text_input_v3 *text_input UNUSED, struct wl_surface *surface UNUSED) {
|
||||
text_input_leave(void *data UNUSED, struct zwp_text_input_v3 *txt_input, struct wl_surface *surface UNUSED) {
|
||||
debug("text-input: leave event\n");
|
||||
if (text_input) {
|
||||
zwp_text_input_v3_disable(text_input);
|
||||
if (txt_input) {
|
||||
zwp_text_input_v3_disable(txt_input);
|
||||
commit();
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
static void
|
||||
send_text(const char *text, GLFWIMEState ime_state) {
|
||||
_GLFWwindow *w = _glfwFocusedWindow();
|
||||
if (w && w->callbacks.keyboard) {
|
||||
@@ -57,7 +57,7 @@ send_text(const char *text, GLFWIMEState ime_state) {
|
||||
static void
|
||||
text_input_preedit_string(
|
||||
void *data UNUSED,
|
||||
struct zwp_text_input_v3 *text_input UNUSED,
|
||||
struct zwp_text_input_v3 *txt_input UNUSED,
|
||||
const char *text,
|
||||
int32_t cursor_begin,
|
||||
int32_t cursor_end
|
||||
@@ -68,7 +68,7 @@ text_input_preedit_string(
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_commit_string(void *data UNUSED, struct zwp_text_input_v3 *text_input UNUSED, const char *text) {
|
||||
text_input_commit_string(void *data UNUSED, struct zwp_text_input_v3 *txt_input UNUSED, const char *text) {
|
||||
debug("text-input: commit_string event: text: %s\n", text);
|
||||
free(pending_commit);
|
||||
pending_commit = text ? _glfw_strdup(text) : NULL;
|
||||
@@ -77,14 +77,14 @@ text_input_commit_string(void *data UNUSED, struct zwp_text_input_v3 *text_input
|
||||
static void
|
||||
text_input_delete_surrounding_text(
|
||||
void *data UNUSED,
|
||||
struct zwp_text_input_v3 *zwp_text_input_v3 UNUSED,
|
||||
struct zwp_text_input_v3 *txt_input UNUSED,
|
||||
uint32_t before_length,
|
||||
uint32_t after_length) {
|
||||
debug("text-input: delete_surrounding_text event: before_length: %u after_length: %u\n", before_length, after_length);
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_done(void *data UNUSED, struct zwp_text_input_v3 *zwp_text_input_v3 UNUSED, uint32_t serial UNUSED) {
|
||||
text_input_done(void *data UNUSED, struct zwp_text_input_v3 *txt_input UNUSED, uint32_t serial UNUSED) {
|
||||
debug("text-input: done event: serial: %u current_commit_serial: %u\n", serial, commit_serial);
|
||||
if (serial != commit_serial) {
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: text_input_done serial mismatch, expected=%u got=%u\n", commit_serial, serial);
|
||||
|
||||
80
glfw/wl_window.c
vendored
@@ -413,9 +413,15 @@ static void setFullscreen(_GLFWwindow* window, _GLFWmonitor* monitor, bool on)
|
||||
setIdleInhibitor(window, on);
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
_glfwPlatformIsFullscreen(_GLFWwindow *window, unsigned int flags UNUSED) {
|
||||
return window->wl.toplevel_states & TOPLEVEL_STATE_FULLSCREEN;
|
||||
}
|
||||
|
||||
bool
|
||||
_glfwPlatformToggleFullscreen(_GLFWwindow *window, unsigned int flags UNUSED) {
|
||||
bool already_fullscreen = window->wl.toplevel_states & TOPLEVEL_STATE_FULLSCREEN;
|
||||
bool already_fullscreen = _glfwPlatformIsFullscreen(window, flags);
|
||||
setFullscreen(window, NULL, !already_fullscreen);
|
||||
return !already_fullscreen;
|
||||
}
|
||||
@@ -890,9 +896,9 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
|
||||
if (width != window->wl.width || height != window->wl.height) {
|
||||
window->wl.user_requested_content_size.width = width;
|
||||
window->wl.user_requested_content_size.height = height;
|
||||
int32_t width = 0, height = 0;
|
||||
set_csd_window_geometry(window, &width, &height);
|
||||
window->wl.width = width; window->wl.height = height;
|
||||
int32_t w = 0, h = 0;
|
||||
set_csd_window_geometry(window, &w, &h);
|
||||
window->wl.width = w; window->wl.height = h;
|
||||
resizeFramebuffer(window);
|
||||
ensure_csd_resources(window);
|
||||
wl_surface_commit(window->wl.surface);
|
||||
@@ -1561,11 +1567,6 @@ static void mark_primary_selection_offer(void *data UNUSED, struct zwp_primary_s
|
||||
|
||||
static void
|
||||
set_offer_mimetype(_GLFWWaylandDataOffer* offer, const char* mime) {
|
||||
if (strcmp(mime, "text/plain;charset=utf-8") == 0) {
|
||||
offer->plain_text_mime = "text/plain;charset=utf-8";
|
||||
} else if (!offer->plain_text_mime && strcmp(mime, "text/plain")) {
|
||||
offer->plain_text_mime = "text/plain";
|
||||
}
|
||||
if (strcmp(mime, clipboard_mime()) == 0) {
|
||||
offer->is_self_offer = true;
|
||||
}
|
||||
@@ -1666,9 +1667,9 @@ static void drag_enter(void *data UNUSED, struct wl_data_device *wl_data_device
|
||||
while (window)
|
||||
{
|
||||
if (window->wl.surface == surface) {
|
||||
for (size_t x = 0; x < d->mimes_count; x++) {
|
||||
int prio = _glfwInputDrop(window, d->mimes[x], NULL, 0);
|
||||
if (prio > format_priority) d->mime_for_drop = d->mimes[x];
|
||||
for (size_t j = 0; j < d->mimes_count; j++) {
|
||||
int prio = _glfwInputDrop(window, d->mimes[j], NULL, 0);
|
||||
if (prio > format_priority) d->mime_for_drop = d->mimes[j];
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1694,8 +1695,8 @@ static void drop(void *data UNUSED, struct wl_data_device *wl_data_device UNUSED
|
||||
for (size_t i = 0; i < arraysz(_glfw.wl.dataOffers); i++) {
|
||||
if (_glfw.wl.dataOffers[i].offer_type == DRAG_AND_DROP && _glfw.wl.dataOffers[i].mime_for_drop) {
|
||||
size_t sz = 0;
|
||||
char *data = read_data_offer(_glfw.wl.dataOffers[i].id, _glfw.wl.dataOffers[i].mime_for_drop, &sz);
|
||||
if (data) {
|
||||
char *d = read_data_offer(_glfw.wl.dataOffers[i].id, _glfw.wl.dataOffers[i].mime_for_drop, &sz);
|
||||
if (d) {
|
||||
// We dont do finish as this requires version 3 for wl_data_device_manager
|
||||
// which then requires more work with calling set_actions for drag and drop to function
|
||||
// wl_data_offer_finish(_glfw.wl.dataOffers[i].id);
|
||||
@@ -1704,13 +1705,13 @@ static void drop(void *data UNUSED, struct wl_data_device *wl_data_device UNUSED
|
||||
while (window)
|
||||
{
|
||||
if (window->wl.surface == _glfw.wl.dataOffers[i].surface) {
|
||||
_glfwInputDrop(window, _glfw.wl.dataOffers[i].mime_for_drop, data, sz);
|
||||
_glfwInputDrop(window, _glfw.wl.dataOffers[i].mime_for_drop, d, sz);
|
||||
break;
|
||||
}
|
||||
window = window->next;
|
||||
}
|
||||
|
||||
free(data);
|
||||
free(d);
|
||||
}
|
||||
destroy_data_offer(&_glfw.wl.dataOffers[i]);
|
||||
break;
|
||||
@@ -1762,7 +1763,7 @@ void _glfwSetupWaylandPrimarySelectionDevice() {
|
||||
if (_glfw.wl.primarySelectionDevice) zwp_primary_selection_device_v1_add_listener(_glfw.wl.primarySelectionDevice, &primary_selection_device_listener, NULL);
|
||||
}
|
||||
|
||||
static inline bool _glfwEnsureDataDevice(void) {
|
||||
static bool _glfwEnsureDataDevice(void) {
|
||||
if (!_glfw.wl.dataDeviceManager)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
@@ -1814,16 +1815,38 @@ void _glfwPlatformSetClipboardString(const char* string)
|
||||
wl_callback_add_listener(callback, &clipboard_copy_callback_listener, _glfw.wl.dataSourceForClipboard);
|
||||
}
|
||||
|
||||
static bool
|
||||
offer_has_mime(const _GLFWWaylandDataOffer *d, const char *mime) {
|
||||
for (unsigned i = 0; i < d->mimes_count; i++) {
|
||||
if (strcmp(d->mimes[i], mime) == 0) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static const char*
|
||||
plain_text_mime_for_offer(const _GLFWWaylandDataOffer *d) {
|
||||
#define A(x) if (offer_has_mime(d, x)) return x;
|
||||
A("text/plain;charset=utf-8");
|
||||
A("text/plain");
|
||||
A("UTF8_STRING");
|
||||
A("STRING");
|
||||
#undef A
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char* _glfwPlatformGetClipboardString(void)
|
||||
{
|
||||
for (size_t i = 0; i < arraysz(_glfw.wl.dataOffers); i++) {
|
||||
_GLFWWaylandDataOffer *d = _glfw.wl.dataOffers + i;
|
||||
if (d->id && d->offer_type == CLIPBOARD && d->plain_text_mime) {
|
||||
if (d->id && d->offer_type == CLIPBOARD) {
|
||||
if (d->is_self_offer) return _glfw.wl.clipboardString;
|
||||
free(_glfw.wl.pasteString);
|
||||
size_t sz = 0;
|
||||
_glfw.wl.pasteString = read_data_offer(d->id, d->plain_text_mime, &sz);
|
||||
return _glfw.wl.pasteString;
|
||||
const char *mime = plain_text_mime_for_offer(d);
|
||||
if (mime) {
|
||||
free(_glfw.wl.pasteString);
|
||||
size_t sz = 0;
|
||||
_glfw.wl.pasteString = read_data_offer(d->id, mime, &sz);
|
||||
return _glfw.wl.pasteString;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
@@ -1871,13 +1894,14 @@ const char* _glfwPlatformGetPrimarySelectionString(void)
|
||||
|
||||
for (size_t i = 0; i < arraysz(_glfw.wl.dataOffers); i++) {
|
||||
_GLFWWaylandDataOffer *d = _glfw.wl.dataOffers + i;
|
||||
if (d->id && d->is_primary && d->offer_type == PRIMARY_SELECTION && d->plain_text_mime) {
|
||||
if (d->is_self_offer) {
|
||||
return _glfw.wl.primarySelectionString;
|
||||
if (d->id && d->is_primary && d->offer_type == PRIMARY_SELECTION) {
|
||||
if (d->is_self_offer) return _glfw.wl.primarySelectionString;
|
||||
const char *mime = plain_text_mime_for_offer(d);
|
||||
if (mime) {
|
||||
free(_glfw.wl.pasteString);
|
||||
_glfw.wl.pasteString = read_primary_selection_offer(d->id, mime);
|
||||
return _glfw.wl.pasteString;
|
||||
}
|
||||
free(_glfw.wl.pasteString);
|
||||
_glfw.wl.pasteString = read_primary_selection_offer(d->id, d->plain_text_mime);
|
||||
return _glfw.wl.pasteString;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
||||
11
glfw/x11_window.c
vendored
@@ -281,7 +281,7 @@ updateNormalHints(_GLFWwindow* window, int width, int height)
|
||||
XFree(hints);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
is_window_fullscreen(_GLFWwindow* window)
|
||||
{
|
||||
Atom* states;
|
||||
@@ -310,7 +310,7 @@ is_window_fullscreen(_GLFWwindow* window)
|
||||
return ans;
|
||||
}
|
||||
|
||||
static inline void
|
||||
static void
|
||||
set_fullscreen(_GLFWwindow *window, bool on) {
|
||||
if (_glfw.x11.NET_WM_STATE && _glfw.x11.NET_WM_STATE_FULLSCREEN) {
|
||||
sendEventToWM(window,
|
||||
@@ -343,6 +343,11 @@ set_fullscreen(_GLFWwindow *window, bool on) {
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
_glfwPlatformIsFullscreen(_GLFWwindow *window, unsigned int flags UNUSED) {
|
||||
return is_window_fullscreen(window);
|
||||
}
|
||||
|
||||
bool
|
||||
_glfwPlatformToggleFullscreen(_GLFWwindow *window, unsigned int flags UNUSED) {
|
||||
bool already_fullscreen = is_window_fullscreen(window);
|
||||
@@ -2646,7 +2651,7 @@ void _glfwPlatformSetWindowOpacity(_GLFWwindow* window, float opacity)
|
||||
PropModeReplace, (unsigned char*) &value, 1);
|
||||
}
|
||||
|
||||
static inline unsigned
|
||||
static unsigned
|
||||
dispatch_x11_queued_events(int num_events) {
|
||||
unsigned dispatched = num_events > 0 ? num_events : 0;
|
||||
while (num_events-- > 0) {
|
||||
|
||||
179
glfw/xkb_glfw.c
vendored
@@ -383,22 +383,162 @@ glfw_xkb_update_masks(_GLFWXKBData *xkb) {
|
||||
#define xkb_glfw_load_keymap(keymap, map_str) keymap = xkb_keymap_new_from_string(xkb->context, map_str, XKB_KEYMAP_FORMAT_TEXT_V1, 0);
|
||||
#define xkb_glfw_load_state(keymap, state) state = xkb_state_new(keymap);
|
||||
|
||||
typedef struct {
|
||||
struct xkb_state *state;
|
||||
int failed;
|
||||
xkb_mod_mask_t used_mods;
|
||||
xkb_mod_mask_t shift, control, capsLock, numLock, alt, super, meta, hyper;
|
||||
|
||||
/* Combination modifiers to try */
|
||||
int try_shift;
|
||||
xkb_keycode_t shift_keycode;
|
||||
} modifier_mapping_algorithm_t;
|
||||
|
||||
/* Algorithm for mapping virtual modifiers to real modifiers:
|
||||
* 1. create new state
|
||||
* 2. for each key in keymap
|
||||
* a. send key down to state
|
||||
* b. if it affected exactly one bit in modifier map
|
||||
* i) get keysym
|
||||
* ii) if keysym matches one of the known modifiers, save it for that modifier
|
||||
* iii) if modifier is latched, send key up and key down to toggle again
|
||||
* c. send key up to reset the state
|
||||
* 3. if shift key found in step 2, run step 2 with all shift+key for each key
|
||||
* 4. if shift, control, alt and super are not all found, declare failure
|
||||
* 5. if failure, use static mapping from xkbcommon-names.h
|
||||
*
|
||||
* Step 3 is needed because many popular keymaps map meta to alt+shift.
|
||||
*
|
||||
* We could do better by constructing a system of linear equations, but it should not be
|
||||
* needed in any sane system. We could also use this algorithm with X11, but X11
|
||||
* provides XkbVirtualModsToReal which is guaranteed to be accurate, while this
|
||||
* algorithm is only a heuristic.
|
||||
*
|
||||
* We don't touch level3 or level5 modifiers.
|
||||
*/
|
||||
static void modifier_mapping_algorithm( struct xkb_keymap *keymap UNUSED, xkb_keycode_t key, void *data ) {
|
||||
modifier_mapping_algorithm_t *algorithm = ( modifier_mapping_algorithm_t * )data;
|
||||
if ( algorithm->failed )
|
||||
return;
|
||||
|
||||
if ( algorithm->try_shift ) {
|
||||
if ( key == algorithm->shift_keycode ) return;
|
||||
xkb_state_update_key( algorithm->state, algorithm->shift_keycode, XKB_KEY_DOWN );
|
||||
}
|
||||
|
||||
enum xkb_state_component changed_type = xkb_state_update_key( algorithm->state, key, XKB_KEY_DOWN );
|
||||
if ( changed_type & ( XKB_STATE_MODS_DEPRESSED | XKB_STATE_MODS_LATCHED | XKB_STATE_MODS_LOCKED ) ) {
|
||||
xkb_mod_mask_t mods = xkb_state_serialize_mods( algorithm->state,
|
||||
algorithm->try_shift ? XKB_STATE_MODS_EFFECTIVE : ( XKB_STATE_MODS_DEPRESSED | XKB_STATE_MODS_LATCHED | XKB_STATE_MODS_LOCKED ) );
|
||||
|
||||
const xkb_keysym_t *keysyms;
|
||||
int num_keysyms = xkb_state_key_get_syms( algorithm->state, key, &keysyms );
|
||||
/* We can handle exactly one keysym with exactly one bit set in the implementation
|
||||
* below; with a lot more gymnastics, we could set up an 8x8 linear system and solve
|
||||
* for each modifier in case there are some modifiers that are only present in
|
||||
* combination with others, but it is not worth the effort. */
|
||||
if ( num_keysyms == 1 && mods && ( mods & ( mods-1 ) ) == 0 ) {
|
||||
#define S2( k, a ) \
|
||||
do { \
|
||||
if ( keysyms[0] == XKB_KEY_##k##_L || keysyms[0] == XKB_KEY_##k##_R ) { \
|
||||
if ( !algorithm->a ) \
|
||||
algorithm->a = mods; \
|
||||
else if ( algorithm->a != mods ) \
|
||||
algorithm->failed = 1; \
|
||||
} \
|
||||
} while ( 0 )
|
||||
#define S1( k, a ) if ( ( keysyms[0] == XKB_KEY_##k ) && !algorithm->a ) algorithm->a = mods
|
||||
S2( Shift, shift );
|
||||
S2( Control, control );
|
||||
S1( Caps_Lock, capsLock );
|
||||
S1( Shift_Lock, numLock );
|
||||
S2( Alt, alt );
|
||||
S2( Super, super );
|
||||
S2( Meta, meta );
|
||||
S2( Hyper, hyper );
|
||||
#undef S1
|
||||
#undef S2
|
||||
}
|
||||
if ( !algorithm->shift_keycode && ( keysyms[0] == XKB_KEY_Shift_L || keysyms[0] == XKB_KEY_Shift_R ) )
|
||||
algorithm->shift_keycode = key;
|
||||
|
||||
/* If this is a lock, then up and down to remove lock state*/
|
||||
if ( changed_type & XKB_STATE_MODS_LOCKED ) { /* What should we do for LATCHED here? */
|
||||
xkb_state_update_key( algorithm->state, key, XKB_KEY_UP );
|
||||
xkb_state_update_key( algorithm->state, key, XKB_KEY_DOWN );
|
||||
}
|
||||
}
|
||||
xkb_state_update_key( algorithm->state, key, XKB_KEY_UP );
|
||||
|
||||
if ( algorithm->try_shift ) {
|
||||
xkb_state_update_key( algorithm->state, algorithm->shift_keycode, XKB_KEY_UP );
|
||||
}
|
||||
}
|
||||
|
||||
static int local_modifier_mapping(_GLFWXKBData *xkb) {
|
||||
modifier_mapping_algorithm_t algorithm;
|
||||
|
||||
algorithm.failed = 0;
|
||||
algorithm.used_mods = 0;
|
||||
algorithm.shift = algorithm.control = algorithm.capsLock = algorithm.numLock = algorithm.alt = algorithm.super = algorithm.meta = algorithm.hyper = 0;
|
||||
algorithm.try_shift = 0;
|
||||
algorithm.shift_keycode = 0;
|
||||
|
||||
algorithm.state = xkb_state_new( xkb->keymap );
|
||||
if ( algorithm.state != NULL )
|
||||
{
|
||||
xkb_keymap_key_for_each( xkb->keymap, &modifier_mapping_algorithm, &algorithm );
|
||||
if ( !algorithm.shift_keycode )
|
||||
algorithm.failed = 1;
|
||||
|
||||
if ( !( algorithm.shift && algorithm.control && algorithm.alt && algorithm.super && algorithm.meta && algorithm.hyper )
|
||||
&& !algorithm.failed ) {
|
||||
algorithm.try_shift = 1;
|
||||
xkb_keymap_key_for_each( xkb->keymap, &modifier_mapping_algorithm, &algorithm );
|
||||
}
|
||||
xkb_state_unref( algorithm.state );
|
||||
if ( !algorithm.failed && !( algorithm.shift && algorithm.control && algorithm.alt && algorithm.super ) )
|
||||
algorithm.failed = 1; /* must have found at least those 4 modifiers */
|
||||
}
|
||||
|
||||
if ( !algorithm.failed ) {
|
||||
#define S( a ) xkb->a##Idx = XKB_MOD_INVALID; xkb->a##Mask = 0
|
||||
S(control); S(shift); S(capsLock); S(alt); S(super); S(hyper); S(meta); S(numLock);
|
||||
#undef S
|
||||
|
||||
unsigned indx, shifted, used_bits = 0;
|
||||
for (indx = 0, shifted = 1; indx < 32; ++indx, shifted <<= 1) {
|
||||
#define S( a ) if ( (xkb->a##Idx == XKB_MOD_INVALID) && !( used_bits & shifted ) && algorithm.a == shifted ) xkb->a##Idx = indx, xkb->a##Mask = shifted, used_bits |= shifted
|
||||
S(control); S(shift); S(capsLock); S(alt); S(super); S(hyper); S(meta); S(numLock);
|
||||
#undef S
|
||||
}
|
||||
}
|
||||
|
||||
if ( algorithm.failed )
|
||||
debug( "Wayland modifier autodetection algorithm failed; using defaults\n" );
|
||||
return !algorithm.failed;
|
||||
}
|
||||
|
||||
static void
|
||||
glfw_xkb_update_masks(_GLFWXKBData *xkb) {
|
||||
// Should find better solution under Wayland
|
||||
// See https://github.com/kovidgoyal/kitty/pull/3430 for discussion
|
||||
// See https://github.com/kovidgoyal/kitty/pull/3943 for discussion
|
||||
|
||||
if ( getenv( "KITTY_WAYLAND_DETECT_MODIFIERS" ) == NULL || !local_modifier_mapping( xkb ) ) {
|
||||
#define S( a ) xkb->a##Idx = XKB_MOD_INVALID; xkb->a##Mask = 0
|
||||
S(hyper); S(meta);
|
||||
S(hyper); S(meta);
|
||||
#undef S
|
||||
#define S(a, n) xkb->a##Idx = xkb_keymap_mod_get_index(xkb->keymap, n); xkb->a##Mask = 1 << xkb->a##Idx;
|
||||
S(control, XKB_MOD_NAME_CTRL);
|
||||
S(shift, XKB_MOD_NAME_SHIFT);
|
||||
S(capsLock, XKB_MOD_NAME_CAPS);
|
||||
S(numLock, XKB_MOD_NAME_NUM);
|
||||
S(alt, XKB_MOD_NAME_ALT);
|
||||
S(super, XKB_MOD_NAME_LOGO);
|
||||
S(control, XKB_MOD_NAME_CTRL);
|
||||
S(shift, XKB_MOD_NAME_SHIFT);
|
||||
S(capsLock, XKB_MOD_NAME_CAPS);
|
||||
S(numLock, XKB_MOD_NAME_NUM);
|
||||
S(alt, XKB_MOD_NAME_ALT);
|
||||
S(super, XKB_MOD_NAME_LOGO);
|
||||
#undef S
|
||||
}
|
||||
debug("Modifier indices alt: 0x%x super: 0x%x hyper: 0x%x meta: 0x%x numlock: 0x%x shift: 0x%x capslock: 0x%x control: 0x%x\n",
|
||||
xkb->altIdx, xkb->superIdx, xkb->hyperIdx, xkb->metaIdx, xkb->numLockIdx, xkb->shiftIdx, xkb->capsLockIdx, xkb->controlIdx);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -490,7 +630,7 @@ load_compose_tables(_GLFWXKBData *xkb) {
|
||||
xkb_compose_table_unref(compose_table);
|
||||
}
|
||||
|
||||
static inline xkb_mod_mask_t
|
||||
static xkb_mod_mask_t
|
||||
active_unknown_modifiers(_GLFWXKBData *xkb, struct xkb_state *state) {
|
||||
size_t i = 0;
|
||||
xkb_mod_mask_t ans = 0;
|
||||
@@ -577,7 +717,7 @@ glfw_xkb_should_repeat(_GLFWXKBData *xkb, xkb_keycode_t keycode) {
|
||||
}
|
||||
|
||||
|
||||
static inline xkb_keysym_t
|
||||
static xkb_keysym_t
|
||||
compose_symbol(struct xkb_compose_state *composeState, xkb_keysym_t sym, int *compose_completed, char *key_text, int n) {
|
||||
*compose_completed = 0;
|
||||
if (sym == XKB_KEY_NoSymbol || !composeState) return sym;
|
||||
@@ -610,7 +750,7 @@ glfw_xkb_keysym_from_name(const char *name, bool case_sensitive) {
|
||||
return (int)xkb_keysym_from_name(name, case_sensitive ? XKB_KEYSYM_NO_FLAGS : XKB_KEYSYM_CASE_INSENSITIVE);
|
||||
}
|
||||
|
||||
static inline const char*
|
||||
static const char*
|
||||
format_mods(unsigned int mods) {
|
||||
static char buf[128];
|
||||
char *p = buf, *s;
|
||||
@@ -632,7 +772,7 @@ format_mods(unsigned int mods) {
|
||||
return buf;
|
||||
}
|
||||
|
||||
static inline const char*
|
||||
static const char*
|
||||
format_xkb_mods(_GLFWXKBData *xkb, const char* name, xkb_mod_mask_t mods) {
|
||||
static char buf[512];
|
||||
char *p = buf, *s;
|
||||
@@ -702,6 +842,19 @@ glfw_xkb_key_from_ime(_GLFWIBUSKeyEvent *ev, bool handled_by_ime, bool failed) {
|
||||
last_handled_press_keycode = ev->glfw_ev.native_key;
|
||||
}
|
||||
|
||||
void
|
||||
glfw_xkb_forwarded_key_from_ime(xkb_keysym_t keysym, unsigned int glfw_mods) {
|
||||
_GLFWwindow *w = _glfwFocusedWindow();
|
||||
if (w && w->callbacks.keyboard) {
|
||||
GLFWkeyevent fake_ev = {.action = GLFW_PRESS};
|
||||
fake_ev.native_key = keysym;
|
||||
fake_ev.key = glfw_key_for_sym(keysym);
|
||||
fake_ev.mods = glfw_mods;
|
||||
fake_ev.ime_state = GLFW_IME_NONE;
|
||||
w->callbacks.keyboard((GLFWwindow*) w, &fake_ev);
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
is_switch_layout_key(xkb_keysym_t xkb_sym) {
|
||||
return xkb_sym == XKB_KEY_ISO_First_Group || xkb_sym == XKB_KEY_ISO_Last_Group || xkb_sym == XKB_KEY_ISO_Next_Group || xkb_sym == XKB_KEY_ISO_Prev_Group || xkb_sym == XKB_KEY_Mode_switch;
|
||||
@@ -713,7 +866,7 @@ glfw_xkb_handle_key_event(_GLFWwindow *window, _GLFWXKBData *xkb, xkb_keycode_t
|
||||
const xkb_keysym_t *syms, *clean_syms, *default_syms;
|
||||
xkb_keysym_t xkb_sym, shifted_xkb_sym = XKB_KEY_NoSymbol, alternate_xkb_sym = XKB_KEY_NoSymbol;
|
||||
xkb_keycode_t code_for_sym = xkb_keycode, ibus_keycode = xkb_keycode;
|
||||
GLFWkeyevent glfw_ev = {.action = GLFW_PRESS};
|
||||
GLFWkeyevent glfw_ev = {.action = GLFW_PRESS, .native_key_id = xkb_keycode};
|
||||
#ifdef _GLFW_WAYLAND
|
||||
code_for_sym += 8;
|
||||
#else
|
||||
|
||||
1
glfw/xkb_glfw.h
vendored
@@ -98,3 +98,4 @@ void glfw_xkb_handle_key_event(_GLFWwindow *window, _GLFWXKBData *xkb, xkb_keyco
|
||||
int glfw_xkb_keysym_from_name(const char *name, bool case_sensitive);
|
||||
void glfw_xkb_update_ime_state(_GLFWwindow *w, _GLFWXKBData *xkb, const GLFWIMEUpdateEvent *ev);
|
||||
void glfw_xkb_key_from_ime(_GLFWIBUSKeyEvent *ev, bool handled_by_ime, bool failed);
|
||||
void glfw_xkb_forwarded_key_from_ime(xkb_keysym_t keysym, unsigned int glfw_mods);
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
#!/usr/bin/env python3
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
import os
|
||||
import sys
|
||||
from contextlib import suppress
|
||||
from typing import TYPE_CHECKING, List, Optional, Tuple
|
||||
from typing import TYPE_CHECKING, Dict, List, NamedTuple, Optional, Tuple
|
||||
|
||||
from kitty.cli import parse_args
|
||||
from kitty.cli_stub import AskCLIOptions
|
||||
from kitty.constants import cache_dir
|
||||
from kitty.typing import BossType
|
||||
from kitty.fast_data_types import wcswidth
|
||||
from kitty.typing import BossType, TypedDict
|
||||
from kitty.utils import ScreenSize
|
||||
|
||||
from ..tui.handler import result_handler
|
||||
from ..tui.operations import alternate_screen, styled
|
||||
from ..tui.utils import get_key_press
|
||||
from ..tui.handler import Handler, result_handler
|
||||
from ..tui.loop import Loop, MouseEvent
|
||||
from ..tui.operations import MouseTracking, alternate_screen, styled
|
||||
|
||||
if TYPE_CHECKING:
|
||||
import readline
|
||||
@@ -97,45 +98,109 @@ For example: y:Yes and n;red:No
|
||||
'''
|
||||
|
||||
|
||||
try:
|
||||
from typing import TypedDict
|
||||
except ImportError:
|
||||
TypedDict = dict
|
||||
|
||||
|
||||
class Response(TypedDict):
|
||||
items: List[str]
|
||||
response: Optional[str]
|
||||
|
||||
|
||||
def choice(cli_opts: AskCLIOptions, items: List[str]) -> Response:
|
||||
with alternate_screen():
|
||||
if cli_opts.message:
|
||||
print(styled(cli_opts.message, bold=True))
|
||||
print()
|
||||
allowed = ''
|
||||
for choice in cli_opts.choices:
|
||||
color = 'green'
|
||||
letter, text = choice.split(':', maxsplit=1)
|
||||
if ';' in letter:
|
||||
letter, color = letter.split(';', maxsplit=1)
|
||||
letter = letter.lower()
|
||||
idx = text.lower().index(letter)
|
||||
allowed += letter
|
||||
print(text[:idx], styled(text[idx], fg=color), text[idx + 1:], sep='', end=' ')
|
||||
print()
|
||||
response = get_key_press(allowed, '')
|
||||
return {'items': items, 'response': response}
|
||||
class Choice(NamedTuple):
|
||||
text: str
|
||||
idx: int
|
||||
color: str
|
||||
|
||||
|
||||
def yesno(cli_opts: AskCLIOptions, items: List[str]) -> Response:
|
||||
with alternate_screen():
|
||||
if cli_opts.message:
|
||||
print(styled(cli_opts.message, bold=True))
|
||||
print()
|
||||
print(' ', styled('Y', fg='green') + 'es', ' ', styled('N', fg='red') + 'o')
|
||||
response = get_key_press('yn', 'n')
|
||||
return {'items': items, 'response': response}
|
||||
class Range(NamedTuple):
|
||||
start: int
|
||||
end: int
|
||||
y: int
|
||||
|
||||
def has_point(self, x: int, y: int) -> bool:
|
||||
return y == self.y and self.start <= x <= self.end
|
||||
|
||||
|
||||
class Choose(Handler):
|
||||
mouse_tracking = MouseTracking.buttons_only
|
||||
|
||||
def __init__(self, cli_opts: AskCLIOptions) -> None:
|
||||
self.cli_opts = cli_opts
|
||||
self.response = 'n' if cli_opts.type == 'yesno' else ''
|
||||
self.allowed = frozenset('yn')
|
||||
self.choices: Dict[str, Choice] = {}
|
||||
self.clickable_ranges: Dict[str, Range] = {}
|
||||
if cli_opts.type != 'yesno':
|
||||
allowed = []
|
||||
for choice in cli_opts.choices:
|
||||
color = 'green'
|
||||
letter, text = choice.split(':', maxsplit=1)
|
||||
if ';' in letter:
|
||||
letter, color = letter.split(';', maxsplit=1)
|
||||
letter = letter.lower()
|
||||
idx = text.lower().index(letter)
|
||||
allowed.append(letter)
|
||||
self.choices[letter] = Choice(text, idx, color)
|
||||
self.allowed = frozenset(allowed)
|
||||
|
||||
def initialize(self) -> None:
|
||||
self.cmd.set_cursor_visible(False)
|
||||
self.draw_screen()
|
||||
|
||||
def finalize(self) -> None:
|
||||
self.cmd.set_cursor_visible(True)
|
||||
|
||||
@Handler.atomic_update
|
||||
def draw_screen(self) -> None:
|
||||
self.cmd.clear_screen()
|
||||
y = 1
|
||||
if self.cli_opts.message:
|
||||
self.cmd.styled(self.cli_opts.message, bold=True)
|
||||
y += wcswidth(self.cli_opts.message) // self.screen_size.cols
|
||||
self.print()
|
||||
if self.cli_opts.type == 'yesno':
|
||||
self.draw_yesno(y)
|
||||
else:
|
||||
self.draw_choice(y)
|
||||
|
||||
def draw_choice(self, y: int) -> None:
|
||||
x = 0
|
||||
self.clickable_ranges.clear()
|
||||
for letter, choice in self.choices.items():
|
||||
text = choice.text[:choice.idx]
|
||||
text += styled(choice.text[choice.idx], fg=choice.color)
|
||||
text += choice.text[choice.idx + 1:]
|
||||
text += ' '
|
||||
sz = wcswidth(text)
|
||||
if sz + x >= self.screen_size.cols:
|
||||
y += 1
|
||||
x = 0
|
||||
self.print()
|
||||
self.clickable_ranges[letter] = Range(x, x + sz - 1, y)
|
||||
x += sz
|
||||
self.print(text, end='')
|
||||
|
||||
def draw_yesno(self, y: int) -> None:
|
||||
self.clickable_ranges = {'y': Range(2, 4, y), 'n': Range(8, 9, y)}
|
||||
self.print(' ', styled('Y', fg='green') + 'es', ' ', styled('N', fg='red') + 'o')
|
||||
|
||||
def on_text(self, text: str, in_bracketed_paste: bool = False) -> None:
|
||||
text = text.lower()
|
||||
if text in self.allowed:
|
||||
self.response = text
|
||||
self.quit_loop(0)
|
||||
|
||||
def on_click(self, ev: MouseEvent) -> None:
|
||||
for letter, r in self.clickable_ranges.items():
|
||||
if r.has_point(ev.cell_x, ev.cell_y):
|
||||
self.response = letter
|
||||
self.quit_loop(0)
|
||||
break
|
||||
|
||||
def on_resize(self, screen_size: ScreenSize) -> None:
|
||||
self.screen_size = screen_size
|
||||
self.draw_screen()
|
||||
|
||||
def on_interrupt(self) -> None:
|
||||
self.quit_loop(1)
|
||||
on_eot = on_interrupt
|
||||
|
||||
|
||||
def main(args: List[str]) -> Response:
|
||||
@@ -152,15 +217,16 @@ def main(args: List[str]) -> Response:
|
||||
input('Press enter to quit...')
|
||||
raise SystemExit(e.code)
|
||||
|
||||
if cli_opts.type == 'yesno':
|
||||
return yesno(cli_opts, items)
|
||||
if cli_opts.type == 'choices':
|
||||
return choice(cli_opts, items)
|
||||
if cli_opts.type in ('yesno', 'choices'):
|
||||
loop = Loop()
|
||||
handler = Choose(cli_opts)
|
||||
loop.loop(handler)
|
||||
return {'items': items, 'response': handler.response}
|
||||
|
||||
import readline as rl
|
||||
readline = rl
|
||||
from kitty.shell import init_readline
|
||||
init_readline(readline)
|
||||
init_readline()
|
||||
response = None
|
||||
|
||||
with alternate_screen(), HistoryCompleter(cli_opts.name):
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPLv3 Copyright: 2020, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
import sys
|
||||
@@ -12,6 +11,7 @@ from kitty.cli_stub import BroadcastCLIOptions
|
||||
from kitty.key_encoding import encode_key_event
|
||||
from kitty.rc.base import MATCH_TAB_OPTION, MATCH_WINDOW_OPTION
|
||||
from kitty.remote_control import create_basic_command, encode_send
|
||||
from kitty.short_uuid import uuid4
|
||||
from kitty.typing import KeyEventType, ScreenSize
|
||||
|
||||
from ..tui.handler import Handler
|
||||
@@ -20,18 +20,27 @@ from ..tui.loop import Loop
|
||||
from ..tui.operations import RESTORE_CURSOR, SAVE_CURSOR, styled
|
||||
|
||||
|
||||
def session_command(payload: Dict[str, Any], start: bool = True) -> bytes:
|
||||
payload = payload.copy()
|
||||
payload['data'] = 'session:' + ('start' if start else 'end')
|
||||
send = create_basic_command('send-text', payload, no_response=True)
|
||||
return encode_send(send)
|
||||
|
||||
|
||||
class Broadcast(Handler):
|
||||
|
||||
def __init__(self, opts: BroadcastCLIOptions, initial_strings: List[str]) -> None:
|
||||
self.opts = opts
|
||||
self.initial_strings = initial_strings
|
||||
self.payload = {'exclude_active': True, 'data': '', 'match': opts.match_tab, 'match_tab': opts.match_tab}
|
||||
self.payload = {'exclude_active': True, 'data': '', 'match': opts.match, 'match_tab': opts.match_tab, 'session_id': uuid4()}
|
||||
self.line_edit = LineEdit()
|
||||
self.session_started = False
|
||||
if not opts.match and not opts.match_tab:
|
||||
self.payload['all'] = True
|
||||
|
||||
def initialize(self) -> None:
|
||||
self.print('Type the text to broadcast below, press', styled('Ctrl+c', fg='yellow'), 'to quit:')
|
||||
self.write_broadcast_session()
|
||||
self.print('Type the text to broadcast below, press', styled('Ctrl+Esc', fg='yellow'), 'to quit:')
|
||||
for x in self.initial_strings:
|
||||
self.write_broadcast_text(x)
|
||||
self.write(SAVE_CURSOR)
|
||||
@@ -51,7 +60,9 @@ class Broadcast(Handler):
|
||||
self.commit_line()
|
||||
|
||||
def on_interrupt(self) -> None:
|
||||
self.quit_loop(0)
|
||||
self.write_broadcast_text('\x03')
|
||||
self.line_edit.clear()
|
||||
self.commit_line()
|
||||
|
||||
def on_eot(self) -> None:
|
||||
self.write_broadcast_text('\x04')
|
||||
@@ -65,6 +76,9 @@ class Broadcast(Handler):
|
||||
self.line_edit.clear()
|
||||
self.write(SAVE_CURSOR)
|
||||
return
|
||||
if key_event.matches('ctrl+esc'):
|
||||
self.quit_loop(0)
|
||||
return
|
||||
|
||||
ek = encode_key_event(key_event)
|
||||
ek = standard_b64encode(ek.encode('utf-8')).decode('ascii')
|
||||
@@ -79,6 +93,10 @@ class Broadcast(Handler):
|
||||
send = create_basic_command('send-text', payload, no_response=True)
|
||||
self.write(encode_send(send))
|
||||
|
||||
def write_broadcast_session(self, start: bool = True) -> None:
|
||||
self.session_started = start
|
||||
self.write(session_command(self.payload, start))
|
||||
|
||||
|
||||
OPTIONS = (MATCH_WINDOW_OPTION + '\n\n' + MATCH_TAB_OPTION.replace('--match -m', '--match-tab -t')).format
|
||||
help_text = 'Broadcast typed text to all kitty windows. By default text is sent to all windows, unless one of the matching options is specified'
|
||||
@@ -98,11 +116,16 @@ def main(args: List[str]) -> Optional[Dict[str, Any]]:
|
||||
input(_('Press Enter to quit'))
|
||||
return None
|
||||
|
||||
print('Type text to be broadcast below, Ctrl-C to quit:', end='\r\n')
|
||||
sys.stdout.flush()
|
||||
loop = Loop()
|
||||
handler = Broadcast(opts, items)
|
||||
loop.loop(handler)
|
||||
try:
|
||||
loop.loop(handler)
|
||||
finally:
|
||||
if handler.session_started:
|
||||
sys.stdout.buffer.write(session_command(handler.payload, False))
|
||||
sys.stdout.buffer.flush()
|
||||
return None
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -55,7 +55,7 @@ create_job(size_t i, size_t blocksz, GlobalData *global) {
|
||||
if (ans->start >= global->haystack_count) ans->count = 0;
|
||||
else ans->count = global->haystack_count - ans->start;
|
||||
ans->max_haystack_len = 0;
|
||||
for (size_t i = ans->start; i < ans->start + ans->count; i++) ans->max_haystack_len = MAX(ans->max_haystack_len, global->haystack[i].haystack_len);
|
||||
for (size_t j = ans->start; j < ans->start + ans->count; j++) ans->max_haystack_len = MAX(ans->max_haystack_len, global->haystack[j].haystack_len);
|
||||
if (ans->count > 0) {
|
||||
ans->workspace = alloc_workspace(ans->max_haystack_len, global);
|
||||
if (!ans->workspace) { free(ans); return NULL; }
|
||||
|
||||
@@ -1,49 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
import sys
|
||||
from typing import Iterable, List, Union
|
||||
from typing import List
|
||||
|
||||
from kitty.key_encoding import KeyEvent
|
||||
|
||||
from . import subseq_matcher
|
||||
from ..tui.handler import Handler
|
||||
from ..tui.loop import Loop
|
||||
|
||||
|
||||
def match(
|
||||
input_data: Union[str, bytes, Iterable[Union[str, bytes]]],
|
||||
query: str,
|
||||
threads: int = 0,
|
||||
positions: bool = False,
|
||||
level1: str = '/',
|
||||
level2: str = '-_0123456789',
|
||||
level3: str = '.',
|
||||
limit: int = 0,
|
||||
mark_before: str = '',
|
||||
mark_after: str = '',
|
||||
delimiter: str = '\n'
|
||||
) -> List[str]:
|
||||
if isinstance(input_data, str):
|
||||
idata = [x.encode('utf-8') for x in input_data.split(delimiter)]
|
||||
elif isinstance(input_data, bytes):
|
||||
idata = input_data.split(delimiter.encode('utf-8'))
|
||||
else:
|
||||
idata = [x.encode('utf-8') if isinstance(x, str) else x for x in input_data]
|
||||
query = query.lower()
|
||||
level1 = level1.lower()
|
||||
level2 = level2.lower()
|
||||
level3 = level3.lower()
|
||||
data = subseq_matcher.match(
|
||||
idata, (level1, level2, level3), query,
|
||||
positions, limit, threads,
|
||||
mark_before, mark_after, delimiter)
|
||||
if data is None:
|
||||
return []
|
||||
return list(filter(None, data.split(delimiter or '\n')))
|
||||
|
||||
|
||||
class ChooseHandler(Handler):
|
||||
|
||||
def initialize(self) -> None:
|
||||
|
||||
38
kittens/choose/match.py
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env python
|
||||
# License: GPLv3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
from typing import Iterable, List, Union
|
||||
|
||||
from . import subseq_matcher
|
||||
|
||||
|
||||
def match(
|
||||
input_data: Union[str, bytes, Iterable[Union[str, bytes]]],
|
||||
query: str,
|
||||
threads: int = 0,
|
||||
positions: bool = False,
|
||||
level1: str = '/',
|
||||
level2: str = '-_0123456789',
|
||||
level3: str = '.',
|
||||
limit: int = 0,
|
||||
mark_before: str = '',
|
||||
mark_after: str = '',
|
||||
delimiter: str = '\n'
|
||||
) -> List[str]:
|
||||
if isinstance(input_data, str):
|
||||
idata = [x.encode('utf-8') for x in input_data.split(delimiter)]
|
||||
elif isinstance(input_data, bytes):
|
||||
idata = input_data.split(delimiter.encode('utf-8'))
|
||||
else:
|
||||
idata = [x.encode('utf-8') if isinstance(x, str) else x for x in input_data]
|
||||
query = query.lower()
|
||||
level1 = level1.lower()
|
||||
level2 = level2.lower()
|
||||
level3 = level3.lower()
|
||||
data = subseq_matcher.match(
|
||||
idata, (level1, level2, level3), query,
|
||||
positions, limit, threads,
|
||||
mark_before, mark_after, delimiter)
|
||||
if data is None:
|
||||
return []
|
||||
return list(filter(None, data.split(delimiter or '\n')))
|
||||
@@ -14,7 +14,7 @@
|
||||
#ifdef ISWINDOWS
|
||||
#include <io.h>
|
||||
#define STDOUT_FILENO 1
|
||||
static inline ssize_t ms_write(int fd, const void* buf, size_t count) { return _write(fd, buf, (unsigned int)count); }
|
||||
static ssize_t ms_write(int fd, const void* buf, size_t count) { return _write(fd, buf, (unsigned int)count); }
|
||||
#define write ms_write
|
||||
#else
|
||||
#include <unistd.h>
|
||||
@@ -24,7 +24,7 @@ static inline ssize_t ms_write(int fd, const void* buf, size_t count) { return _
|
||||
|
||||
#define FIELD(x, which) (((Candidate*)(x))->which)
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
ensure_space(GlobalData *global, size_t sz) {
|
||||
if (global->output_sz < sz + global->output_pos || !global->output) {
|
||||
size_t before = global->output_sz;
|
||||
@@ -38,7 +38,7 @@ ensure_space(GlobalData *global, size_t sz) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void
|
||||
static void
|
||||
output_text(GlobalData *global, const text_t *data, size_t sz) {
|
||||
if (ensure_space(global, sz)) {
|
||||
memcpy(global->output + global->output_pos, data, sizeof(text_t) * sz);
|
||||
@@ -66,10 +66,10 @@ static void
|
||||
output_positions(GlobalData *global, len_t *positions, len_t num) {
|
||||
wchar_t buf[128];
|
||||
for (len_t i = 0; i < num; i++) {
|
||||
int num = swprintf(buf, sizeof(buf)/sizeof(buf[0]), L"%u", positions[i]);
|
||||
if (num > 0 && ensure_space(global, num + 1)) {
|
||||
for (int i = 0; i < num; i++) global->output[global->output_pos++] = buf[i];
|
||||
global->output[global->output_pos++] = (i == num - 1) ? ',' : ':';
|
||||
int pnum = swprintf(buf, arraysz(buf), L"%u", positions[i]);
|
||||
if (pnum > 0 && ensure_space(global, pnum + 1)) {
|
||||
for (int k = 0; k < pnum; k++) global->output[global->output_pos++] = buf[k];
|
||||
global->output[global->output_pos++] = (i == num - 1) ? ':' : ',';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ free_workspace(void *v) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
has_char(text_t *text, len_t sz, text_t ch) {
|
||||
for(len_t i = 0; i < sz; i++) {
|
||||
if(text[i] == ch) return true;
|
||||
@@ -67,7 +67,7 @@ has_char(text_t *text, len_t sz, text_t ch) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline uint8_t
|
||||
static uint8_t
|
||||
level_factor_for(text_t current, text_t last, WorkSpace *w) {
|
||||
text_t lch = LOWERCASE(last);
|
||||
if (has_char(w->level1, w->level1_len, lch)) return 90;
|
||||
@@ -101,7 +101,7 @@ init_workspace(WorkSpace *w, text_t *haystack, len_t haystack_len) {
|
||||
}
|
||||
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
has_atleast_one_match(WorkSpace *w) {
|
||||
int p = -1;
|
||||
bool found;
|
||||
@@ -118,7 +118,7 @@ has_atleast_one_match(WorkSpace *w) {
|
||||
|
||||
#define POSITION(x) w->positions[x][w->address[x]]
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
increment_address(WorkSpace *w) {
|
||||
len_t pos = w->needle_len - 1;
|
||||
while(true) {
|
||||
@@ -130,7 +130,7 @@ increment_address(WorkSpace *w) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
static bool
|
||||
address_is_monotonic(WorkSpace *w) {
|
||||
// Check if the character positions pointed to by the current address are monotonic
|
||||
for (len_t i = 1; i < w->needle_len; i++) {
|
||||
@@ -139,7 +139,7 @@ address_is_monotonic(WorkSpace *w) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline double
|
||||
static double
|
||||
calc_score(WorkSpace *w) {
|
||||
double ans = 0;
|
||||
len_t distance, pos;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
import os
|
||||
@@ -57,9 +56,9 @@ OPTIONS = r'''
|
||||
--get-clipboard
|
||||
default=False
|
||||
type=bool-set
|
||||
Output the current contents of the clipboard to stdout. Note that this
|
||||
will not work if you have not enabled the option to allow reading the clipboard
|
||||
in kitty.conf
|
||||
Output the current contents of the clipboard to STDOUT. Note that by default
|
||||
kitty will prompt you asking to allow access to the clipboard. Can be controlled
|
||||
by :opt:`clipboard_control`.
|
||||
|
||||
|
||||
--use-primary
|
||||
@@ -78,10 +77,10 @@ the kitten in a dedicated, ephemeral window.
|
||||
help_text = '''\
|
||||
Read or write to the system clipboard.
|
||||
|
||||
To set the clipboard text, pipe in the new text on stdin. Use the
|
||||
To set the clipboard text, pipe in the new text on STDIN. Use the
|
||||
:option:`--get-clipboard` option to output the current clipboard contents to
|
||||
:file:`stdout`. Note that you must enable reading of clipboard in
|
||||
:file:`kitty.conf` first.
|
||||
:file:`stdout`. Note that reading the clipboard will cause a permission
|
||||
popup, see :opt:`clipboard_control` for details.
|
||||
'''
|
||||
|
||||
usage = ''
|
||||
@@ -94,7 +93,7 @@ def main(args: List[str]) -> NoReturn:
|
||||
data: Optional[bytes] = None
|
||||
if not sys.stdin.isatty():
|
||||
data = sys.stdin.buffer.read()
|
||||
sys.stdin = open(os.ctermid(), 'r')
|
||||
sys.stdin = open(os.ctermid())
|
||||
loop = Loop()
|
||||
handler = Clipboard(data, cli_opts)
|
||||
loop.loop(handler)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
import os
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
import os
|
||||
|
||||
@@ -4,9 +4,9 @@ from .collect import Segment
|
||||
|
||||
|
||||
def split_with_highlights(
|
||||
line: str, truncate_points: List[int], fg_highlights: List,
|
||||
line: str, truncate_points: List[int], fg_highlights: List[Segment],
|
||||
bg_highlight: Optional[Segment]
|
||||
) -> List:
|
||||
) -> List[str]:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
import concurrent
|
||||
@@ -22,7 +21,7 @@ class StyleNotFound(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class DiffFormatter(Formatter):
|
||||
class DiffFormatter(Formatter): # type: ignore
|
||||
|
||||
def __init__(self, style: str = 'default') -> None:
|
||||
try:
|
||||
@@ -31,7 +30,7 @@ class DiffFormatter(Formatter):
|
||||
except ClassNotFound:
|
||||
initialized = False
|
||||
if not initialized:
|
||||
raise StyleNotFound('pygments style "{}" not found'.format(style))
|
||||
raise StyleNotFound(f'pygments style "{style}" not found')
|
||||
|
||||
self.styles: Dict[str, Tuple[str, str]] = {}
|
||||
for token, token_style in self.style:
|
||||
@@ -153,7 +152,7 @@ def highlight_collection(collection: Collection, aliases: Optional[Dict[str, str
|
||||
try:
|
||||
highlights = future.result()
|
||||
except Exception as e:
|
||||
return 'Running syntax highlighting for {} generated an exception: {}'.format(path, e)
|
||||
return f'Running syntax highlighting for {path} generated an exception: {e}'
|
||||
ans[path] = highlights
|
||||
return ans
|
||||
|
||||
@@ -166,5 +165,5 @@ def main() -> None:
|
||||
with open(sys.argv[-1]) as f:
|
||||
highlighted = highlight_data(f.read(), f.name, defaults.syntax_aliases)
|
||||
if highlighted is None:
|
||||
raise SystemExit('Unknown filetype: {}'.format(sys.argv[-1]))
|
||||
raise SystemExit(f'Unknown filetype: {sys.argv[-1]}')
|
||||
print(highlighted)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
import atexit
|
||||
@@ -428,7 +427,7 @@ class DiffHandler(Handler):
|
||||
elif self.state is MESSAGE:
|
||||
self.cmd.styled(self.message, reverse=True)
|
||||
else:
|
||||
sp = '{:.0%}'.format(self.scroll_pos/self.max_scroll_pos) if self.scroll_pos and self.max_scroll_pos else '0%'
|
||||
sp = f'{self.scroll_pos/self.max_scroll_pos:.0%}' if self.scroll_pos and self.max_scroll_pos else '0%'
|
||||
scroll_frac = styled(sp, fg=self.opts.margin_fg)
|
||||
if self.current_search is None:
|
||||
counts = '{}{}{}'.format(
|
||||
@@ -437,7 +436,7 @@ class DiffHandler(Handler):
|
||||
styled(str(self.removed_count), fg=self.opts.highlight_removed_bg)
|
||||
)
|
||||
else:
|
||||
counts = styled('{} matches'.format(len(self.current_search)), fg=self.opts.margin_fg)
|
||||
counts = styled(f'{len(self.current_search)} matches', fg=self.opts.margin_fg)
|
||||
suffix = counts + ' ' + scroll_frac
|
||||
prefix = styled(':', fg=self.opts.margin_fg)
|
||||
filler = self.screen_size.cols - wcswidth(prefix) - wcswidth(suffix)
|
||||
@@ -632,7 +631,7 @@ def main(args: List[str]) -> None:
|
||||
raise SystemExit('The items to be diffed should both be either directories or files. Comparing a directory to a file is not valid.')
|
||||
for f in left, right:
|
||||
if not os.path.exists(f):
|
||||
raise SystemExit('{} does not exist'.format(f))
|
||||
raise SystemExit(f'{f} does not exist')
|
||||
|
||||
loop = Loop()
|
||||
handler = DiffHandler(cli_opts, opts, left, right)
|
||||
|
||||
@@ -54,7 +54,7 @@ agr('colors', 'Colors')
|
||||
opt('pygments_style', 'default',
|
||||
long_text='''
|
||||
The pygments color scheme to use for syntax highlighting. See :link:`pygments
|
||||
colors schemes <https://help.farbox.com/pygments.html>` for a list of schemes.
|
||||
builtin styles <https://pygments.org/styles/>` for a list of schemes.
|
||||
'''
|
||||
)
|
||||
|
||||
|
||||