Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 2e38f63

Browse files
committed
feat: Job api should allow passing through desired kill signal
1 parent 37d7117 commit 2e38f63

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/core/src/core/jobs/job.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
export interface Abortable {
18-
abort(): void
18+
abort(signal?: string): void
1919
}
2020

2121
export interface Resizable {

plugins/plugin-bash-like/src/pty/client.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
Capabilities,
2727
Tab,
2828
REPL,
29+
Job,
2930
Abortable,
3031
FlowControllable,
3132
XtermResponse,
@@ -940,7 +941,7 @@ export const doExec = (
940941
// this function will be called just prior to executing the
941942
// command against the websocket/channel
942943
const init = async (ws: Channel) => {
943-
const job = {
944+
const job: Job = {
944945
write: (data: string) => ws.send(JSON.stringify({ type: 'data', data, uuid: ourUUID })),
945946
xon: () => {
946947
debug('xon requested')
@@ -953,9 +954,9 @@ export const doExec = (
953954
resize: (rows: number, cols: number) => {
954955
ws.send(JSON.stringify({ type: 'resize', rows, cols, uuid: ourUUID }))
955956
},
956-
abort: () => {
957+
abort: (signal?: string) => {
957958
debug('abort requested')
958-
ws.send(JSON.stringify({ type: 'kill', uuid: ourUUID }))
959+
ws.send(JSON.stringify({ type: 'kill', uuid: ourUUID, signal }))
959960
}
960961
}
961962

0 commit comments

Comments
 (0)