MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / execute_command_action

Method execute_command_action

crates/opencode-tui/src/app/app.rs:1614–1774  ·  view source on GitHub ↗
(&mut self, action: CommandAction)

Source from the content-addressed store, hash-verified

1612 }
1613
1614 fn execute_command_action(&mut self, action: CommandAction) -> anyhow::Result<()> {
1615 match action {
1616 CommandAction::SubmitPrompt => self.submit_prompt()?,
1617 CommandAction::ClearPrompt => self.prompt.clear(),
1618 CommandAction::PasteClipboard => self.paste_clipboard_to_prompt(),
1619 CommandAction::CopyPrompt => self.copy_prompt_to_clipboard(),
1620 CommandAction::CutPrompt => self.cut_prompt_to_clipboard(),
1621 CommandAction::HistoryPrevious => self.prompt.history_previous_entry(),
1622 CommandAction::HistoryNext => self.prompt.history_next_entry(),
1623 CommandAction::ToggleSidebar => self.context.toggle_sidebar(),
1624 CommandAction::ToggleHeader => self.context.toggle_header(),
1625 CommandAction::ToggleScrollbar => self.context.toggle_scrollbar(),
1626 CommandAction::SwitchSession => {
1627 self.refresh_session_list_dialog();
1628 self.session_list_dialog
1629 .open(self.active_session_id.as_deref());
1630 }
1631 CommandAction::RenameSession => {
1632 self.open_session_rename_dialog();
1633 }
1634 CommandAction::ExportSession => {
1635 self.open_session_export_dialog();
1636 }
1637 CommandAction::PromptStashPush => {
1638 if self.prompt.stash_current() {
1639 self.alert_dialog.set_message("Prompt stashed.");
1640 self.alert_dialog.open();
1641 } else {
1642 self.alert_dialog
1643 .set_message("Prompt is empty, nothing to stash.");
1644 self.alert_dialog.open();
1645 }
1646 }
1647 CommandAction::PromptStashList => {
1648 self.open_prompt_stash_dialog();
1649 }
1650 CommandAction::PromptSkillList => {
1651 self.open_skill_list_dialog();
1652 }
1653 CommandAction::SwitchTheme => {
1654 self.refresh_theme_list_dialog();
1655 let current_theme = self.context.current_theme_name();
1656 self.theme_list_dialog.open(&current_theme);
1657 }
1658 CommandAction::CycleVariant => {
1659 self.cycle_model_variant();
1660 }
1661 CommandAction::ToggleAppearance => {
1662 let _ = self.context.toggle_theme_mode();
1663 }
1664 CommandAction::ViewStatus => {
1665 self.refresh_status_dialog();
1666 self.status_dialog.open();
1667 }
1668 CommandAction::ToggleMcp => {
1669 let _ = self.refresh_mcp_dialog();
1670 self.mcp_dialog.open();
1671 }

Callers 2

handle_eventMethod · 0.80
handle_dialog_keyMethod · 0.80

Calls 15

submit_promptMethod · 0.80
history_next_entryMethod · 0.80
toggle_sidebarMethod · 0.80
toggle_headerMethod · 0.80
toggle_scrollbarMethod · 0.80

Tested by

no test coverage detected