Skip to content

Commit 8261e9b

Browse files
committed
chore(core): update send output messages
1 parent aec9c99 commit 8261e9b

File tree

2 files changed

+12
-26
lines changed

2 files changed

+12
-26
lines changed

packages/nx/src/native/tui/components/help_popup.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::any::Any;
1212
use tokio::sync::mpsc::UnboundedSender;
1313

1414
use super::{Component, Frame};
15-
use crate::native::tui::action::Action;
15+
use crate::native::tui::{action::Action, nx_console};
1616

1717
use crate::native::tui::theme::THEME;
1818

@@ -159,11 +159,19 @@ impl HelpPopup {
159159

160160
if self.console_available {
161161
// add Copilot specific keybindings for AI assistance
162+
162163
keybindings.extend([
163164
("", ""),
164165
(
165166
"<ctrl>+a",
166-
"Send this output to Copilot so that it can assist with any issues",
167+
match nx_console::get_current_editor() {
168+
nx_console::SupportedEditor::VSCode => {
169+
"Send terminal output to Copilot so that it can assist with any issues"
170+
}
171+
_ => {
172+
"Send terminal output to your AI assistant so that it can assist with any issues"
173+
}
174+
},
167175
),
168176
]);
169177
}

packages/nx/src/native/tui/components/terminal_pane.rs

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -509,37 +509,15 @@ impl<'a> StatefulWidget for TerminalPane<'a> {
509509
),
510510
])
511511
} else {
512-
let mut spans = vec![
512+
let spans = vec![
513513
Span::raw(" "),
514514
Span::styled("i", Style::default().fg(THEME.info)),
515515
Span::styled(
516516
" to make interactive ",
517517
Style::default().fg(THEME.secondary_fg),
518518
),
519519
];
520-
if state.console_available {
521-
let mut ai_info = vec![
522-
Span::raw(" "),
523-
Span::styled("<ctrl>+a", Style::default().fg(THEME.info)),
524-
];
525-
526-
if matches!(
527-
nx_console::get_current_editor(),
528-
nx_console::SupportedEditor::VSCode
529-
) {
530-
ai_info.push(Span::styled(
531-
" to this send output to Copilot",
532-
Style::default().fg(THEME.secondary_fg),
533-
))
534-
} else {
535-
ai_info.push(Span::styled(
536-
" to send output to your editor's AI assistant",
537-
Style::default().fg(THEME.secondary_fg),
538-
))
539-
}
540-
541-
spans.extend(ai_info);
542-
}
520+
543521
Line::from(spans)
544522
};
545523

0 commit comments

Comments
 (0)