Skip to content

Commit bf6aa3e

Browse files
committed
Fix CI
1 parent c590a52 commit bf6aa3e

3 files changed

Lines changed: 287 additions & 8 deletions

File tree

Package.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ let targets: [Target] = [
6565
name: "SwiftTermTests",
6666
dependencies: ["SwiftTerm"],
6767
path: "Tests/SwiftTermTests",
68-
resources: [.copy("Fixtures/xterm-ghostty.infocmp")]
68+
resources: [
69+
.copy("Fixtures/xterm-ghostty.infocmp"),
70+
.copy("Fixtures/swifterm-terminfo.infocmp")
71+
]
6972
)
7073
] + buildInfoTargets
7174
#else
@@ -130,7 +133,10 @@ let targets: [Target] = [
130133
name: "SwiftTermTests",
131134
dependencies: ["SwiftTerm"],
132135
path: "Tests/SwiftTermTests",
133-
resources: [.copy("Fixtures/xterm-ghostty.infocmp")]
136+
resources: [
137+
.copy("Fixtures/xterm-ghostty.infocmp"),
138+
.copy("Fixtures/swifterm-terminfo.infocmp")
139+
]
134140
)
135141
] + benchmarkTargets + buildInfoTargets
136142
#endif
Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
# SwiftTerm terminfo entry, based on the fixed xterm-ghostty compatibility baseline.
2+
swifterm-terminfo,
3+
am,
4+
bce,
5+
ccc,
6+
hs,
7+
km,
8+
mc5i,
9+
mir,
10+
msgr,
11+
npc,
12+
xenl,
13+
AX,
14+
Su,
15+
Tc,
16+
XT,
17+
fullkbd,
18+
colors#256,
19+
cols#80,
20+
it#8,
21+
lines#24,
22+
pairs#32767,
23+
acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
24+
bel=^G,
25+
blink=\E[5m,
26+
bold=\E[1m,
27+
cbt=\E[Z,
28+
civis=\E[?25l,
29+
clear=\E[H\E[2J,
30+
cnorm=\E[?12l\E[?25h,
31+
cr=^M,
32+
csr=\E[%i%p1%d;%p2%dr,
33+
cub=\E[%p1%dD,
34+
cub1=^H,
35+
cud=\E[%p1%dB,
36+
cud1=^J,
37+
cuf=\E[%p1%dC,
38+
cuf1=\E[C,
39+
cup=\E[%i%p1%d;%p2%dH,
40+
cuu=\E[%p1%dA,
41+
cuu1=\E[A,
42+
cvvis=\E[?12;25h,
43+
dch=\E[%p1%dP,
44+
dch1=\E[P,
45+
dim=\E[2m,
46+
dl=\E[%p1%dM,
47+
dl1=\E[M,
48+
dsl=\E]2;\007,
49+
ech=\E[%p1%dX,
50+
ed=\E[J,
51+
el=\E[K,
52+
el1=\E[1K,
53+
flash=\E[?5h$<100/>\E[?5l,
54+
fsl=^G,
55+
home=\E[H,
56+
hpa=\E[%i%p1%dG,
57+
ht=^I,
58+
hts=\EH,
59+
ich=\E[%p1%d@,
60+
ich1=\E[@,
61+
il=\E[%p1%dL,
62+
il1=\E[L,
63+
ind=^J,
64+
indn=\E[%p1%dS,
65+
initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\,
66+
invis=\E[8m,
67+
kDC=\E[3;2~,
68+
kEND=\E[1;2F,
69+
kHOM=\E[1;2H,
70+
kIC=\E[2;2~,
71+
kLFT=\E[1;2D,
72+
kNXT=\E[6;2~,
73+
kPRV=\E[5;2~,
74+
kRIT=\E[1;2C,
75+
kbs=\177,
76+
kcbt=\E[Z,
77+
kcub1=\EOD,
78+
kcud1=\EOB,
79+
kcuf1=\EOC,
80+
kcuu1=\EOA,
81+
kdch1=\E[3~,
82+
kend=\EOF,
83+
kent=\EOM,
84+
kf1=\EOP,
85+
kf10=\E[21~,
86+
kf11=\E[23~,
87+
kf12=\E[24~,
88+
kf13=\E[1;2P,
89+
kf14=\E[1;2Q,
90+
kf15=\E[1;2R,
91+
kf16=\E[1;2S,
92+
kf17=\E[15;2~,
93+
kf18=\E[17;2~,
94+
kf19=\E[18;2~,
95+
kf2=\EOQ,
96+
kf20=\E[19;2~,
97+
kf21=\E[20;2~,
98+
kf22=\E[21;2~,
99+
kf23=\E[23;2~,
100+
kf24=\E[24;2~,
101+
kf25=\E[1;5P,
102+
kf26=\E[1;5Q,
103+
kf27=\E[1;5R,
104+
kf28=\E[1;5S,
105+
kf29=\E[15;5~,
106+
kf3=\EOR,
107+
kf30=\E[17;5~,
108+
kf31=\E[18;5~,
109+
kf32=\E[19;5~,
110+
kf33=\E[20;5~,
111+
kf34=\E[21;5~,
112+
kf35=\E[23;5~,
113+
kf36=\E[24;5~,
114+
kf37=\E[1;6P,
115+
kf38=\E[1;6Q,
116+
kf39=\E[1;6R,
117+
kf4=\EOS,
118+
kf40=\E[1;6S,
119+
kf41=\E[15;6~,
120+
kf42=\E[17;6~,
121+
kf43=\E[18;6~,
122+
kf44=\E[19;6~,
123+
kf45=\E[20;6~,
124+
kf46=\E[21;6~,
125+
kf47=\E[23;6~,
126+
kf48=\E[24;6~,
127+
kf49=\E[1;3P,
128+
kf5=\E[15~,
129+
kf50=\E[1;3Q,
130+
kf51=\E[1;3R,
131+
kf52=\E[1;3S,
132+
kf53=\E[15;3~,
133+
kf54=\E[17;3~,
134+
kf55=\E[18;3~,
135+
kf56=\E[19;3~,
136+
kf57=\E[20;3~,
137+
kf58=\E[21;3~,
138+
kf59=\E[23;3~,
139+
kf6=\E[17~,
140+
kf60=\E[24;3~,
141+
kf61=\E[1;4P,
142+
kf62=\E[1;4Q,
143+
kf63=\E[1;4R,
144+
kf7=\E[18~,
145+
kf8=\E[19~,
146+
kf9=\E[20~,
147+
khome=\EOH,
148+
kich1=\E[2~,
149+
kind=\E[1;2B,
150+
kmous=\E[<,
151+
knp=\E[6~,
152+
kpp=\E[5~,
153+
kri=\E[1;2A,
154+
oc=\E]104\007,
155+
op=\E[39;49m,
156+
rc=\E8,
157+
rep=%p1%c\E[%p2%{1}%-%db,
158+
rev=\E[7m,
159+
ri=\EM,
160+
rin=\E[%p1%dT,
161+
ritm=\E[23m,
162+
rmacs=\E(B,
163+
rmam=\E[?7l,
164+
rmcup=\E[?1049l,
165+
rmir=\E[4l,
166+
rmkx=\E[?1l\E>,
167+
rmso=\E[27m,
168+
rmul=\E[24m,
169+
rs1=\E]\E\\\Ec,
170+
sc=\E7,
171+
setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
172+
setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
173+
sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
174+
sgr0=\E(B\E[m,
175+
sitm=\E[3m,
176+
smacs=\E(0,
177+
smam=\E[?7h,
178+
smcup=\E[?1049h,
179+
smir=\E[4h,
180+
smkx=\E[?1h\E=,
181+
smso=\E[7m,
182+
smul=\E[4m,
183+
tbc=\E[3g,
184+
tsl=\E]2;,
185+
u6=\E[%i%d;%dR,
186+
u7=\E[6n,
187+
u8=\E[?%[;0123456789]c,
188+
u9=\E[c,
189+
vpa=\E[%i%p1%dd,
190+
BD=\E[?2004l,
191+
BE=\E[?2004h,
192+
Clmg=\E[s,
193+
Cmg=\E[%i%p1%d;%p2%ds,
194+
Dsmg=\E[?69l,
195+
E3=\E[3J,
196+
Enmg=\E[?69h,
197+
Ms=\E]52;%p1%s;%p2%s\007,
198+
PE=\E[201~,
199+
PS=\E[200~,
200+
RV=\E[>c,
201+
Se=\E[2 q,
202+
Setulc=\E[58\:2\:\:%p1%{65536}%/%d\:%p1%{256}%/%{255}%&%d\:%p1%{255}%&%d%;m,
203+
Smulx=\E[4\:%p1%dm,
204+
Ss=\E[%p1%d q,
205+
Sync=\E[?2026%?%p1%{1}%-%tl%eh%;,
206+
XM=\E[?1006;1000%?%p1%{1}%=%th%el%;,
207+
XR=\E[>0q,
208+
fd=\E[?1004l,
209+
fe=\E[?1004h,
210+
kDC3=\E[3;3~,
211+
kDC4=\E[3;4~,
212+
kDC5=\E[3;5~,
213+
kDC6=\E[3;6~,
214+
kDC7=\E[3;7~,
215+
kDN=\E[1;2B,
216+
kDN3=\E[1;3B,
217+
kDN4=\E[1;4B,
218+
kDN5=\E[1;5B,
219+
kDN6=\E[1;6B,
220+
kDN7=\E[1;7B,
221+
kEND3=\E[1;3F,
222+
kEND4=\E[1;4F,
223+
kEND5=\E[1;5F,
224+
kEND6=\E[1;6F,
225+
kEND7=\E[1;7F,
226+
kHOM3=\E[1;3H,
227+
kHOM4=\E[1;4H,
228+
kHOM5=\E[1;5H,
229+
kHOM6=\E[1;6H,
230+
kHOM7=\E[1;7H,
231+
kIC3=\E[2;3~,
232+
kIC4=\E[2;4~,
233+
kIC5=\E[2;5~,
234+
kIC6=\E[2;6~,
235+
kIC7=\E[2;7~,
236+
kLFT3=\E[1;3D,
237+
kLFT4=\E[1;4D,
238+
kLFT5=\E[1;5D,
239+
kLFT6=\E[1;6D,
240+
kLFT7=\E[1;7D,
241+
kNXT3=\E[6;3~,
242+
kNXT4=\E[6;4~,
243+
kNXT5=\E[6;5~,
244+
kNXT6=\E[6;6~,
245+
kNXT7=\E[6;7~,
246+
kPRV3=\E[5;3~,
247+
kPRV4=\E[5;4~,
248+
kPRV5=\E[5;5~,
249+
kPRV6=\E[5;6~,
250+
kPRV7=\E[5;7~,
251+
kRIT3=\E[1;3C,
252+
kRIT4=\E[1;4C,
253+
kRIT5=\E[1;5C,
254+
kRIT6=\E[1;6C,
255+
kRIT7=\E[1;7C,
256+
kUP=\E[1;2A,
257+
kUP3=\E[1;3A,
258+
kUP4=\E[1;4A,
259+
kUP5=\E[1;5A,
260+
kUP6=\E[1;6A,
261+
kUP7=\E[1;7A,
262+
kxIN=\E[I,
263+
kxOUT=\E[O,
264+
rmxx=\E[29m,
265+
rv=\E\\[[0-9]+;[0-9]+;[0-9]+c,
266+
setrgbb=\E[48\:2\:%p1%d\:%p2%d\:%p3%dm,
267+
setrgbf=\E[38\:2\:%p1%d\:%p2%d\:%p3%dm,
268+
smxx=\E[9m,
269+
xm=\E[<%i%p3%d;%p1%d;%p2%d;%?%p4%tM%em%;,
270+
xr=\EP>\\|[ -~]+a\E\\,

Tests/SwiftTermTests/TerminfoCompatibilityTests.swift

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ struct TerminfoCompatibilityTests {
1212
)
1313
}
1414

15+
private func swiftTermFixtureURL() throws -> URL {
16+
try #require(
17+
Bundle.module.url(forResource: "swifterm-terminfo", withExtension: "infocmp")
18+
?? Bundle.module.url(forResource: "swifterm-terminfo", withExtension: "infocmp",
19+
subdirectory: "Fixtures")
20+
)
21+
}
22+
1523
private func fixtureCapabilities() throws -> (names: [String], values: [String: String]) {
1624
let text = try String(contentsOf: fixtureURL(), encoding: .utf8)
1725
let lines = text.split(whereSeparator: \.isNewline).map {
@@ -33,12 +41,7 @@ struct TerminfoCompatibilityTests {
3341
}
3442

3543
@Test func swiftTermEntryMatchesTheFixedGhosttyCapabilities() throws {
36-
let repository = URL(fileURLWithPath: #filePath)
37-
.deletingLastPathComponent()
38-
.deletingLastPathComponent()
39-
.deletingLastPathComponent()
40-
let swiftTermURL = repository.appendingPathComponent("swifterm-terminfo")
41-
let swiftTermText = try String(contentsOf: swiftTermURL, encoding: .utf8)
44+
let swiftTermText = try String(contentsOf: swiftTermFixtureURL(), encoding: .utf8)
4245
let fixtureText = try String(contentsOf: fixtureURL(), encoding: .utf8)
4346
let swiftTermLines = swiftTermText.split(whereSeparator: \.isNewline)
4447
let fixtureLines = fixtureText.split(whereSeparator: \.isNewline)

0 commit comments

Comments
 (0)