tangled
alpha
login
or
join now
woof.monster
/
windows-terminal-raycast
0
fork
atom
launch and manage windows terminal instances with raycast
raycast
raycast-extension
0
fork
atom
overview
issues
pulls
pipelines
add support for aliases in folders
woof.monster
1 month ago
e38aca5d
ee678b7c
+61
-19
1 changed file
expand all
collapse all
unified
split
src
open-profile.tsx
+61
-19
src/open-profile.tsx
···
162
162
}
163
163
164
164
function FolderView(props: { folder: Folder; profiles: Profile[] }) {
165
165
+
const [getAliases, setAliases] = useState<{ [key: string]: { alias: string } }>({});
166
166
+
167
167
+
useEffect(() => {
168
168
+
async function load() {
169
169
+
const profiles = await getAllProfilePreferences();
170
170
+
setAliases(profiles);
171
171
+
}
172
172
+
load();
173
173
+
}, []);
174
174
+
165
175
return (
166
176
<List searchBarPlaceholder={`Search in ${props.folder.name}...`}>
167
177
<List.Section title={props.folder.name}>
···
174
184
<List.Item
175
185
key={item.profile}
176
186
title={props.profiles.filter((profile) => profile.guid === item.profile)[0].name}
177
177
-
actions={<Actions profile={props.profiles.filter((profile) => profile.guid === item.profile)[0]} />}
187
187
+
actions={
188
188
+
<Actions
189
189
+
profile={props.profiles.filter((profile) => profile.guid === item.profile)[0]}
190
190
+
alias={
191
191
+
getAliases[props.profiles.filter((profile) => profile.guid === item.profile)[0].guid]
192
192
+
? getAliases[props.profiles.filter((profile) => profile.guid === item.profile)[0].guid]
193
193
+
.alias
194
194
+
: ""
195
195
+
}
196
196
+
/>
197
197
+
}
178
198
icon={
179
199
props.profiles.filter((profile) => profile.guid === item.profile)[0].source ===
180
200
"Windows.Terminal.SSH"
···
201
221
"{574e775e-4f2a-5b96-ac1e-a2962a402336}" || // Windows PowerShell 7.0+
202
222
props.profiles.filter((profile) => profile.guid === item.profile)[0].source ===
203
223
"Windows.Terminal.PowershellCore" // Windows Powershell 7.0+ (source for better handling)
204
204
-
? ["pwsh", "ps", "posh"]
224
224
+
? [
225
225
+
"pwsh",
226
226
+
"ps",
227
227
+
"posh",
228
228
+
getAliases[props.profiles.filter((profile) => profile.guid === item.profile)[0].guid]
229
229
+
? getAliases[props.profiles.filter((profile) => profile.guid === item.profile)[0].guid]
230
230
+
.alias
231
231
+
: "",
232
232
+
]
205
233
: props.profiles.filter((profile) => profile.guid === item.profile)[0].guid ===
206
234
"{0caa0dad-35be-5f56-a8ff-afceeeaa6101}"
207
207
-
? ["cmd"]
208
208
-
: []
235
235
+
? [
236
236
+
"cmd",
237
237
+
getAliases[props.profiles.filter((profile) => profile.guid === item.profile)[0].guid]
238
238
+
? getAliases[props.profiles.filter((profile) => profile.guid === item.profile)[0].guid]
239
239
+
.alias
240
240
+
: "",
241
241
+
]
242
242
+
: [
243
243
+
getAliases[props.profiles.filter((profile) => profile.guid === item.profile)[0].guid]
244
244
+
? getAliases[props.profiles.filter((profile) => profile.guid === item.profile)[0].guid]
245
245
+
.alias
246
246
+
: "",
247
247
+
]
248
248
+
}
249
249
+
accessories={
250
250
+
getAliases[props.profiles.filter((profile) => profile.guid === item.profile)[0].guid]
251
251
+
? [
252
252
+
{
253
253
+
tag: {
254
254
+
value:
255
255
+
getAliases[props.profiles.filter((profile) => profile.guid === item.profile)[0].guid]
256
256
+
.alias,
257
257
+
},
258
258
+
},
259
259
+
]
260
260
+
: undefined
209
261
}
210
262
/>
211
263
);
···
361
413
? ["pwsh", "ps", "posh", getAliases[item.guid] ? getAliases[item.guid].alias : ""]
362
414
: item.guid === "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}"
363
415
? ["cmd", getAliases[item.guid] ? getAliases[item.guid].alias : ""]
364
364
-
: [
365
365
-
getAliases[item.guid] ? getAliases[item.guid].alias : ""
366
366
-
]
416
416
+
: [getAliases[item.guid] ? getAliases[item.guid].alias : ""]
367
417
}
368
418
accessories={getAliases[item.guid] ? [{ tag: { value: getAliases[item.guid].alias } }] : undefined}
369
369
-
actions={
370
370
-
<Actions profile={item} alias={getAliases[item.guid] ? getAliases[item.guid].alias : ""} />
371
371
-
}
419
419
+
actions={<Actions profile={item} alias={getAliases[item.guid] ? getAliases[item.guid].alias : ""} />}
372
420
/>
373
421
))}
374
422
</List.Section>
···
385
433
title={item.name}
386
434
keywords={[getAliases[item.guid] ? getAliases[item.guid].alias : ""]}
387
435
accessories={getAliases[item.guid] ? [{ tag: { value: getAliases[item.guid].alias } }] : undefined}
388
388
-
actions={
389
389
-
<Actions profile={item} alias={getAliases[item.guid] ? getAliases[item.guid].alias : ""} />
390
390
-
}
436
436
+
actions={<Actions profile={item} alias={getAliases[item.guid] ? getAliases[item.guid].alias : ""} />}
391
437
/>
392
438
))}
393
439
</List.Section>
···
405
451
title={item.name}
406
452
keywords={[getAliases[item.guid] ? getAliases[item.guid].alias : ""]}
407
453
accessories={getAliases[item.guid] ? [{ tag: { value: getAliases[item.guid].alias } }] : undefined}
408
408
-
actions={
409
409
-
<Actions profile={item} alias={getAliases[item.guid] ? getAliases[item.guid].alias : ""} />
410
410
-
}
454
454
+
actions={<Actions profile={item} alias={getAliases[item.guid] ? getAliases[item.guid].alias : ""} />}
411
455
/>
412
456
))}
413
457
</List.Section>
···
430
474
title={item.name}
431
475
keywords={[getAliases[item.guid] ? getAliases[item.guid].alias : ""]}
432
476
accessories={getAliases[item.guid] ? [{ tag: { value: getAliases[item.guid].alias } }] : undefined}
433
433
-
actions={
434
434
-
<Actions profile={item} alias={getAliases[item.guid] ? getAliases[item.guid].alias : ""} />
435
435
-
}
477
477
+
actions={<Actions profile={item} alias={getAliases[item.guid] ? getAliases[item.guid].alias : ""} />}
436
478
/>
437
479
))}
438
480
</List.Section>