feat(coding-agent): add message copy shortcut
This commit is contained in:
@@ -2583,6 +2583,7 @@ export class InteractiveMode {
|
||||
this.defaultEditor.onAction("app.tools.expand", () => this.toggleToolOutputExpansion());
|
||||
this.defaultEditor.onAction("app.thinking.toggle", () => this.toggleThinkingBlockVisibility());
|
||||
this.defaultEditor.onAction("app.editor.external", () => this.openExternalEditor());
|
||||
this.defaultEditor.onAction("app.message.copy", () => void this.handleCopyCommand());
|
||||
this.defaultEditor.onAction("app.message.followUp", () => this.handleFollowUp());
|
||||
this.defaultEditor.onAction("app.message.dequeue", () => this.handleDequeue());
|
||||
this.defaultEditor.onAction("app.session.new", () => this.handleClearCommand());
|
||||
@@ -4708,6 +4709,18 @@ export class InteractiveMode {
|
||||
initialSelectedId,
|
||||
initialFilterMode,
|
||||
);
|
||||
selector.onCopy = async (text) => {
|
||||
if (!text) {
|
||||
this.showError("Selected entry has no text to copy");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await copyToClipboard(text);
|
||||
this.showStatus("Copied selected message to clipboard");
|
||||
} catch (error) {
|
||||
this.showError(error instanceof Error ? error.message : String(error));
|
||||
}
|
||||
};
|
||||
return { component: selector, focus: selector };
|
||||
});
|
||||
}
|
||||
@@ -5735,6 +5748,7 @@ export class InteractiveMode {
|
||||
const toggleThinking = this.getAppKeyDisplay("app.thinking.toggle");
|
||||
const externalEditor = this.getAppKeyDisplay("app.editor.external");
|
||||
const cycleModelBackward = this.getAppKeyDisplay("app.model.cycleBackward");
|
||||
const copyMessage = this.getAppKeyDisplay("app.message.copy");
|
||||
const followUp = this.getAppKeyDisplay("app.message.followUp");
|
||||
const dequeue = this.getAppKeyDisplay("app.message.dequeue");
|
||||
const pasteImage = this.getAppKeyDisplay("app.clipboard.pasteImage");
|
||||
@@ -5778,6 +5792,7 @@ export class InteractiveMode {
|
||||
| \`${expandTools}\` | Toggle tool output expansion |
|
||||
| \`${toggleThinking}\` | Toggle thinking block visibility |
|
||||
| \`${externalEditor}\` | Edit message in external editor |
|
||||
| \`${copyMessage}\` | Copy last assistant message |
|
||||
| \`${followUp}\` | Queue follow-up message |
|
||||
| \`${dequeue}\` | Restore queued messages |
|
||||
| \`${pasteImage}\` | Paste image from clipboard |
|
||||
|
||||
Reference in New Issue
Block a user