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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Every release entry is provided in English and Simplified Chinese.

macOS, Linux, and Android downloads are Preview builds.

#### Added

- Added a "Show administrator shield" switch under Appearance so an elevated Windows session can hide the badge in front of the tab name. The switch changes the marker only; the session keeps its rights.

#### Fixed

- Fixed a delegated prompt remaining in the terminal editor when the agent changed keyboard mode before Enter was sent.
Expand All @@ -35,6 +39,10 @@ macOS, Linux, and Android downloads are Preview builds.

macOS、Linux 和 Android 下载为预览版。

#### 新增

- 外观设置新增“显示管理员盾牌”开关,Windows 提权会话可隐藏标签名前的盾牌标记;开关只影响标记,会话权限不变。

#### 修复

- 修复 Agent 在接收委派内容后切换键盘模式,导致回车未提交、指令留在输入框的问题。
Expand Down
4 changes: 3 additions & 1 deletion nebula_app/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@
"cursor_shape": "Cursor shape",
"blink_cursor": "Blink cursor",
"show_tab_close_buttons": "Show tab close buttons",
"show_administrator_shield": "Show administrator shield",
"interface_density": "Interface density",
"terminal_content_opacity": "Terminal content opacity",
"background_blur": "Background blur",
Expand Down Expand Up @@ -678,7 +679,8 @@
"continues_the_previous_conversation_when": "Continues the previous conversation when restoring an AI tab.",
"shows_ai_session_status_in": "Shows AI session status in the notification area.",
"tab_titles_stay_on_the_directory": "Tabs show the current folder or SSH host.",
"tab_titles_host_and_task": "SSH tabs use the saved host name or address. Hover over a tab to see the current AI task."
"tab_titles_host_and_task": "SSH tabs use the saved host name or address. Hover over a tab to see the current AI task.",
"marks_elevated_windows_sessions": "Marks an elevated Windows session. Turning it off hides the shield only; the session keeps its rights."
},
"pane": {
"keep_tab_titles": "Keep directory and host names in tab titles",
Expand Down
4 changes: 3 additions & 1 deletion nebula_app/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@
"cursor_shape": "光标形状",
"blink_cursor": "光标闪烁",
"show_tab_close_buttons": "显示标签关闭按钮",
"show_administrator_shield": "显示管理员盾牌",
"interface_density": "界面外观",
"terminal_content_opacity": "终端正文不透明度",
"background_blur": "背景模糊",
Expand Down Expand Up @@ -678,7 +679,8 @@
"continues_the_previous_conversation_when": "恢复 AI 标签时,继续上次的对话。",
"shows_ai_session_status_in": "在通知区域查看 AI 会话状态。",
"tab_titles_stay_on_the_directory": "标签显示当前目录或 SSH 主机。",
"tab_titles_host_and_task": "SSH 标签显示保存的主机名或地址。悬停标签可查看当前 AI 任务。"
"tab_titles_host_and_task": "SSH 标签显示保存的主机名或地址。悬停标签可查看当前 AI 任务。",
"marks_elevated_windows_sessions": "标记 Windows 提权会话。关闭只隐藏盾牌,会话权限不变。"
},
"pane": {
"keep_tab_titles": "标签标题保留目录名或主机名",
Expand Down
8 changes: 8 additions & 0 deletions nebula_app/src/gpui_shell/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ pub struct Settings {
pub tab_close_visible: bool,
/// Use the working directory or SSH destination as the automatic tab title.
pub static_tab_titles: bool,
/// 标签前的管理员盾牌:默认显示,关闭只影响标记不影响会话权限。
pub administrator_shield: bool,
pub tab_reveal: nebula_settings::TabRevealName,
pub tab_sleep: nebula_settings::TabSleep,
/// 命令补全设置(settings.txt 的 `ghost`/`completion_style`),
Expand Down Expand Up @@ -136,6 +138,11 @@ pub(crate) fn static_tab_titles(cx: &App) -> bool {
cx.try_global::<Settings>().is_some_and(|settings| settings.static_tab_titles)
}

/// 管理员盾牌开关:未注册全局设置时保持上游的"显示"行为。
pub(crate) fn administrator_shield(cx: &App) -> bool {
cx.try_global::<Settings>().is_none_or(|settings| settings.administrator_shield)
}

#[inline]
fn resolve_ui_language(preference: nebula_settings::LanguagePref) -> UiLanguage {
LanguagePreference::from(preference).resolved()
Expand Down Expand Up @@ -304,6 +311,7 @@ impl Settings {
notification_duration: runtime.notification_duration,
tab_close_visible: runtime.tab_close_visible,
static_tab_titles: runtime.static_tab_titles,
administrator_shield: runtime.administrator_shield,
tab_reveal: runtime.tab_reveal,
tab_sleep: runtime.tab_sleep,
ghost: runtime.ghost,
Expand Down
1 change: 1 addition & 0 deletions nebula_app/src/gpui_shell/settings_pane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,7 @@ impl SettingsPane {
"multiline_paste_confirm" => flag!(multiline_paste_confirm),
"tab_close_visible" => flag!(tab_close_visible),
"static_tab_titles" => flag!(static_tab_titles),
"administrator_shield" => flag!(administrator_shield),
"terminal_proxy" => flag!(terminal_proxy),
"refresh_environment" => flag!(refresh_environment),
"powerline" => flag!(powerline),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ impl SettingsPane {
self.runtime.tab_close_visible,
cx,
))
.child(self.switch_row(
"administrator_shield",
language.text(crate::i18n::Message::SettingsAppearanceShowAdministratorShield),
help("administrator_shield", language),
self.runtime.administrator_shield,
cx,
))
.child(self.select_row(
"language",
language.text(crate::i18n::Message::CommonLanguage),
Expand Down
4 changes: 4 additions & 0 deletions nebula_app/src/gpui_shell/settings_pane/setting_help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ pub(super) fn help(key: &str, language: UiLanguage) -> SettingHelp {
language.text(crate::i18n::Message::SettingsHelpTabTitlesStayOnTheDirectory),
Some(language.text(crate::i18n::Message::SettingsHelpTabTitlesHostAndTask)),
),
"administrator_shield" => {
(language.text(crate::i18n::Message::SettingsHelpMarksElevatedWindowsSessions), None)
}
"keep_session" => (
language.text(crate::i18n::Message::SettingsHelpKeepsTerminalsRunningAfterClosing),
Some(language.text(crate::i18n::Message::SettingsHelpWhenDisabledClosingTheWindow)),
Expand Down Expand Up @@ -193,6 +196,7 @@ mod tests {
"windowing_behavior",
"vcs_display",
"static_tab_titles",
"administrator_shield",
"keep_session",
"restore_session",
"resume_ai",
Expand Down
13 changes: 11 additions & 2 deletions nebula_app/src/gpui_shell/workspace/tab_presentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ impl gpui::RenderOnce for TabIconSlot {
}
}

/// 提权标记要同时成立三件事:用户没关掉开关、本进程已提权、该 pane 继承同一
/// 主机令牌。测试进程无法真实提权,所以三项都从参数注入才能验到关掉开关这一路。
fn shows_administrator_badge(enabled: bool, elevated: bool, inherits_host_token: bool) -> bool {
enabled && elevated && inherits_host_token
}

impl NebulaWorkspace {
/// 完整标签文本。**不在这里截断**:可见宽度是布局问题,字符数上限会在
/// 窄侧栏下漏出、在宽侧栏下白扔字符。截断由 `render_sidebar` 按实测
Expand Down Expand Up @@ -173,8 +179,11 @@ impl NebulaWorkspace {
let title = self.tab_title(ix, cx);
let tab = &self.tabs[ix];
let view = tab.focused_view().map(|entity| entity.read(cx));
let local_administrator = crate::platform::elevation::is_elevated().unwrap_or(false)
&& view.is_some_and(TerminalView::inherits_windows_host_token);
let local_administrator = shows_administrator_badge(
crate::gpui_shell::config::administrator_shield(cx),
crate::platform::elevation::is_elevated().unwrap_or(false),
view.is_some_and(TerminalView::inherits_windows_host_token),
);
let pane_count = match tab {
WorkspaceTab::Terminal { panes, .. } => panes.len(),
_ => 0,
Expand Down
1 change: 1 addition & 0 deletions nebula_settings/src/config_defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub fn ui_value_kind(key: &str) -> Option<UiValueKind> {
| "multiline_paste_confirm"
| "tab_close_visible"
| "static_tab_titles"
| "administrator_shield"
| "powerline"
| "ghost"
| "prompt_suggestions_enabled"
Expand Down
Loading
Loading