Run operator shell commands in a chat's directory on the server
chat_shell_run starts $SHELL -lc in the chat session's directory in its own process group, streams merged output to every watcher of the session, keeps a 1 MiB tail and persists each run; chat_shell_stop interrupts the group and kills it after a grace period. chat_shell_share queues an ordinary prompt with the command and a bounded output tail.
This commit is contained in:
@@ -255,6 +255,9 @@ func handleChat(ctx context.Context, request protocol.Message, broker chatBroker
|
||||
case protocol.ChatShellOutput:
|
||||
handleChatShellOutput(ctx, request, broker, registry, write)
|
||||
return true
|
||||
case protocol.ChatShellRun, protocol.ChatShellStop, protocol.ChatShellRuns, protocol.ChatShellRunOutput, protocol.ChatShellShare:
|
||||
handleChatShellRunRequest(ctx, request, broker, hub, registry, clientID, write)
|
||||
return true
|
||||
case protocol.ChatAttachmentImage:
|
||||
handleChatAttachmentImage(request, broker, write)
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user