Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl Agent {
cache_tracker: CacheTracker::new(),
last_usage: TokenUsage::default(),
locked_tools: None,
system_prompt_override: None,
system_prompt_override: crate::config::config().provider.system_prompt.clone(),
memory_enabled: crate::config::config().features.memory,
stdin_request_tx: None,
}
Expand Down
3 changes: 3 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,8 @@ pub struct ProviderConfig {
/// Copilot premium request mode: "normal", "one", or "zero"
/// "zero" means all requests are free (no premium requests consumed)
pub copilot_premium: Option<String>,
/// Custom system prompt to use instead of the default.
pub system_prompt: Option<String>,
}

impl Default for ProviderConfig {
Expand All @@ -614,6 +616,7 @@ impl Default for ProviderConfig {
cross_provider_failover: CrossProviderFailoverMode::Countdown,
same_provider_account_failover: true,
copilot_premium: None,
system_prompt: None,
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions src/perf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ impl SystemProfile {
pub fn is_wsl_windows_terminal(&self) -> bool {
self.is_wsl && self.is_windows_terminal()
}

pub fn is_vscode_terminal(&self) -> bool {
self.terminal == "vscode"
}
}

static PROFILE: OnceLock<SystemProfile> = OnceLock::new();
Expand Down Expand Up @@ -211,6 +215,14 @@ pub fn tui_policy_for(
linked_side_panel_refresh_interval = std::time::Duration::from_millis(1000);
}

if profile.is_vscode_terminal() {
// VSCodium/VSCode terminal (xterm.js) translates keys via the OS keyboard layout
// before sending escape sequences. Enabling keyboard enhancement causes crossterm to
// reconstruct shifted characters using a hardcoded US layout, breaking international
// keyboard layouts (e.g. Finnish Shift+7 = '/' becomes '&').
enable_keyboard_enhancement = false;
}

match profile.tier {
PerformanceTier::Full => {}
PerformanceTier::Reduced => {
Expand Down