Compare commits

..
2 Commits
Author SHA1 Message Date
okooo 552d55777d release workflow 暂时只打 Windows 包
macOS 和 Linux 的 job 关掉,另行通知后再打开。
2026-10-11 09:59:39 +08:00
okooo 6674a47662 快捷键允许 Shift 加 Insert、Delete、Home、End、Page Up、Page Down
这些键不挡打字,终端粘贴可以录成 Shift+Insert。单独按仍给终端和列表。
2026-10-11 09:57:07 +08:00
6 changed files with 38 additions and 9 deletions

No files matched your search

+4
View File
@@ -82,6 +82,8 @@ jobs:
macos:
needs: verify
# 暂时只打 Windows 包,另行通知后再打开。
if: false
runs-on: macos-14
strategy:
fail-fast: false
@@ -212,6 +214,8 @@ jobs:
linux:
needs: verify
# 暂时只打 Windows 包,另行通知后再打开。
if: false
# Ubuntu 22.04's glibc (2.35) is the oldest the AppImage runs on.
runs-on: ubuntu-22.04
timeout-minutes: 120
+1 -1
View File
@@ -79,7 +79,7 @@ ShellRS(crate 与二进制都叫 `shellrs`)是 Xshell / WinSCP 式的 SSH
- **键盘快捷键**:设置左栏单独一个分类,排在「关键字高亮」下面,分通用、标签、终端、编辑器四组。
- ⌘= / ⌘- / ⌘0 在终端(和它的查找条)里调终端字号(每次 1 像素,经设置写进「终端 › 字号」,范围同那里的 10–28,`FONT_SIZE_RANGE`),在终端外缩放界面(基准字号 12–20,步长 2,不保存)。同主流终端,别改回去。
- 只收主要功能(含新加的下一个 / 上一个 / 切换到标签 1…9),不收 SFTP 文件列表、图片预览的键和 Enter、方向键、Tab、Esc 这类固定键。
- 每行:按键(点了录制「按下组合键」,Esc 或失焦放弃)、禁用、恢复默认。键要带 ⌘ / Ctrl / Alt 或是 F1–F24;撞上同一处的另一个快捷键或输入框等内置键就拒绝并提示占用者,不抢、不允许重复。
- 每行:按键(点了录制「按下组合键」,Esc 或失焦放弃)、禁用、恢复默认。键要带 ⌘ / Ctrl / Alt,或是 F1–F24,或是 Shift 加 Insert / Delete / Home / End / Page Up / Page Down(方向键上方那六个,不挡打字;单独按仍给终端和列表)。撞上同一处的另一个快捷键或输入框等内置键就拒绝并提示占用者,不抢、不允许重复。
- 存在 `settings.json` 的 `shortcuts`,只存和默认不同的(`null` 是禁用)。`Shortcut` 的 `id` 一经发布不能改。
- **关键字高亮**:设置左栏单独一个分类,排在「终端」下面,三组:常规(总开关)、预览(当前终端主题下的示例输出)、规则(N)。规则存在 `settings.json`,所有终端共用。
- 规则表在行里直接改,不弹对话框:拖动把手(一直显示,只有把手能拖)、启用、正则表达式、备注、颜色(gpui-kit `ColorPicker` 加 `#rrggbb` 输入框)、通知、删除(不确认)。规则都是正则,区分大小写;颜色是用户数据,任意 RGB,不跟主题;不做加粗。重叠时靠前的优先。
+1 -1
View File
@@ -111,7 +111,7 @@ The “Settings” button at the bottom of the sidebar, or ⌘, (Ctrl+, on Windo
- **Terminal → Interaction**: with “Copy on select” on, text you select with the mouse is copied to the clipboard when you let go, without pressing ⌘C; it’s off by default, and a click that selects nothing leaves the clipboard as it was. “Right-click” sets what right-clicking in a terminal does: Show menu (the default), Paste (pastes the clipboard, like ⌘V) or Do nothing. With either of the last two, the menu’s Copy, Paste, Find and Clear screen are still on their shortcuts, and Open SFTP and Reconnect are in the tab’s context menu. Changes apply at once to every open terminal.
- **Highlighting**: the main switch, the preview and the rules table, which color text in terminals by rule and alert you on matches; see “Terminal”.
- **Keyboard shortcuts**: the shortcuts of the main features, in four groups (General, Tabs, Terminal, Editor); each row is a feature and its keys. Click the keys to get “Press a key combination”, then press a new combination to use it; Esc or clicking elsewhere cancels. The two buttons at the end of the row are Disable (the row then shows “None”; click again to restore the default) and Restore default; the “Reset All” button at the top of the page restores them all. Changes take effect at once, and the keys shown in tooltips and context menus follow.
- A combination needs ⌘, ⌥ or ⌃ (Ctrl or Alt on Windows and Linux), or must be one of F1–F12; for “Switch to tab 1…9”, press any digit with a modifier, and all nine change together.
- A combination needs ⌘, ⌥ or ⌃ (Ctrl or Alt on Windows and Linux), or must be one of F1–F12, or Shift with Insert, Delete, Home, End, Page Up or Page Down (the six keys above the arrows, which do not type); for “Switch to tab 1…9”, press any digit with a modifier, and all nine change together.
- A combination already taken by another shortcut in the same place, or by text fields and other built-in features, is refused, and you’re told what uses it; to use it anyway, change or disable that one first. Terminal and editor shortcuts can share keys with general shortcuts, and in the terminal or editor they take precedence (in a terminal, for example, ⌘K clears the screen).
- Defaults (macOS / Windows and Linux): New host ⌘N / Ctrl+N, New group ⌘⇧N / Ctrl+Shift+N, Open settings ⌘, / Ctrl+,, Show or hide sidebar ⌘B / Ctrl+B, Show or hide right sidebar ⌘⌥B / Ctrl+Alt+B, Focus search ⌘K / Ctrl+K, Zoom in, Zoom out and Actual size ⌘= ⌘- ⌘0 / Ctrl+= Ctrl+- Ctrl+0, Quit ⌘Q / Ctrl+Q; New local terminal ⌘T / Ctrl+T, Close tab ⌘W / Ctrl+W, Next tab ⌘⇧] / Ctrl+Tab, Previous tab ⌘⇧[ / Ctrl+Shift+Tab, Switch to tab 1…9 ⌘1…⌘9 / Alt+1…9 (9 is the last tab); in the terminal, Copy, Paste, Find, Find next, Find previous and Clear screen ⌘C ⌘V ⌘F ⌘G ⌘⇧G ⌘K / Ctrl+Shift+C, Ctrl+Shift+V, Ctrl+Shift+F, F3, Shift+F3, Ctrl+Shift+K, and Bigger text, Smaller text and Default text size ⌘= ⌘- ⌘0 / Ctrl+= Ctrl+- Ctrl+0; in the editor, Save ⌘S / Ctrl+S. Switching tabs stays within the group of tabs the current tab is in, wrapping around at either end. In a terminal, ⌘= / ⌘- / ⌘0 change the terminal font size (1 pixel at a time, within the same 10–28 range as “Terminal › Font size”; saved in the settings and kept for the next launch); outside a terminal they zoom the whole interface (five steps, back to the default after a restart).
- Shortcuts in the SFTP file list and the image preview, and fixed keys such as Enter, the arrow keys, Tab and Esc, aren’t changed here.
+1 -1
View File
@@ -111,7 +111,7 @@ ShellRS 同一时间只运行一个:已经开着时再打开一次,会把已
- **终端 → 终端交互**:「选中复制」打开后,用鼠标选中文字、松开时就复制到系统剪贴板,不用再按 ⌘C;默认关闭,单击没选中文字时剪贴板不变。「右键行为」决定在终端里按右键做什么:显示菜单(默认)、粘贴(直接粘贴剪贴板,同 ⌘V)、无动作。选后两种时,菜单里的复制、粘贴、查找、清屏仍可用快捷键,打开 SFTP、重新连接在标签的右键菜单里。改动立即作用于所有已打开的终端。
- **关键字高亮**:总开关、预览和规则表,终端里按规则给文字上色、匹配时提醒,见「终端」一节。
- **键盘快捷键**:主要功能的快捷键,分通用、标签、终端、编辑器四组,每行是功能名和它的按键。点按键进入「按下组合键」,按下新的组合就换上;Esc 或点别处放弃。行尾两个按钮:禁用(之后显示「无」,再点一下恢复默认)、恢复默认;页面上方的「重置」也能逐项恢复。改动立即生效,工具栏提示和右键菜单里显示的按键跟着变。
- 组合键要带 ⌘、⌥ 或 ⌃(其他平台 Ctrl 或 Alt),或者是 F1–F12;「切换到标签 1…9」按任意一个带修饰键的数字即可,九个一起换。
- 组合键要带 ⌘、⌥ 或 ⌃(其他平台 Ctrl 或 Alt),或者是 F1–F12,或者 Shift 加 Insert、Delete、Home、End、Page Up、Page Down(方向键上方那六个,不挡打字);「切换到标签 1…9」按任意一个带修饰键的数字即可,九个一起换。
- 已被同一处的另一个快捷键、或输入框等内置功能占用的组合会被拒绝,并提示被谁占用;想换就先改或禁用那一个。终端、编辑器里的快捷键可以和通用快捷键同键,在终端、编辑器里以前者为准(如 ⌘K 在终端里是清屏)。
- 默认(macOS / 其他平台):新建主机 ⌘N / Ctrl+N,新建分组 ⌘⇧N / Ctrl+Shift+N,打开设置 ⌘, / Ctrl+,,显示或隐藏侧栏 ⌘B / Ctrl+B,显示或隐藏右侧栏 ⌘⌥B / Ctrl+Alt+B,聚焦搜索 ⌘K / Ctrl+K,放大、缩小界面和实际大小 ⌘= ⌘- ⌘0 / Ctrl+= Ctrl+- Ctrl+0,退出 ⌘Q / Ctrl+Q;新建本地终端 ⌘T / Ctrl+T,关闭标签 ⌘W / Ctrl+W,下一个标签 ⌘⇧] / Ctrl+Tab,上一个标签 ⌘⇧[ / Ctrl+Shift+Tab,切换到标签 1…9 ⌘1…⌘9 / Alt+1…9(9 是最后一个);终端的复制、粘贴、查找、查找下一个、查找上一个、清屏 ⌘C ⌘V ⌘F ⌘G ⌘⇧G ⌘K / Ctrl+Shift+C、Ctrl+Shift+V、Ctrl+Shift+F、F3、Shift+F3、Ctrl+Shift+K,放大、缩小字号和默认字号 ⌘= ⌘- ⌘0 / Ctrl+= Ctrl+- Ctrl+0;编辑器保存 ⌘S / Ctrl+S。标签切换在当前标签所在的那组标签里进行,首尾循环。⌘= / ⌘- / ⌘0 在终端里调终端字号(每次 1 像素,范围同「终端 › 字号」的 10–28,写进设置,下次启动保留),在终端外缩放整个界面(五档,重启后回到默认)。
- SFTP 文件列表、图片预览的快捷键和 Enter、方向键、Tab、Esc 这些固定键不在这里改。
+4 -4
View File
@@ -95,11 +95,11 @@ app.shortcut_group.editor:
en: Editor
app.shortcut_refusal.needs_modifier_mac:
zh-CN: 快捷键要带 ⌘、⌥ 或 ⌃,或者使用 F1–F12。
en: A shortcut needs ⌘, ⌥ or ⌃, or one of F1–F12.
zh-CN: 快捷键要带 ⌘、⌥ 或 ⌃,或者使用 F1–F12,或者 Shift 加 Insert、Delete、Home、End、Page Up、Page Down。
en: A shortcut needs ⌘, ⌥ or ⌃, or one of F1–F12, or Shift with Insert, Delete, Home, End, Page Up or Page Down.
app.shortcut_refusal.needs_modifier:
zh-CN: 快捷键要带 Ctrl 或 Alt,或者使用 F1–F12。
en: A shortcut needs Ctrl or Alt, or one of F1–F12.
zh-CN: 快捷键要带 Ctrl 或 Alt,或者使用 F1–F12,或者 Shift 加 Insert、Delete、Home、End、Page Up、Page Down。
en: A shortcut needs Ctrl or Alt, or one of F1–F12, or Shift with Insert, Delete, Home, End, Page Up or Page Down.
app.shortcut_refusal.needs_digit_mac:
zh-CN: 这一项要按带修饰键的数字 1,例如 ⌘1。
en: Press the digit 1 with a modifier, such as ⌘1.
+27 -2
View File
@@ -487,7 +487,7 @@ fn same_keystroke(a: &Keystroke, b: &Keystroke) -> bool {
/// Why a key cannot be a shortcut.
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Refusal {
/// A plain key: it would stop typing it.
/// A key that would stop typing: a letter, a digit, or Shift with one.
NeedsModifier,
/// 切换到标签 1…9 takes a modifier with a digit.
NeedsDigit,
@@ -544,7 +544,10 @@ pub fn check(
return Err(Refusal::NeedsDigit);
}
keystroke.key = "1".into();
} else if !held && !is_function_key(&keystroke.key) {
} else if !held
&& !is_function_key(&keystroke.key)
&& !(modifiers.shift && is_cluster_key(&keystroke.key))
{
return Err(Refusal::NeedsModifier);
}
let keys = keystroke.unparse();
@@ -589,6 +592,17 @@ fn is_function_key(key: &str) -> bool {
.is_some_and(|number| (1..=24).contains(&number))
}
/// Insert, Delete, Home, End, Page Up and Page Down: they sit above the
/// arrow keys and type nothing, so Shift with one of them does not stop
/// typing the way Shift+J or Shift+= would. Alone they still go to the
/// terminal or a list, as vim and the SFTP pane use them.
fn is_cluster_key(key: &str) -> bool {
matches!(
key,
"insert" | "delete" | "home" | "end" | "pageup" | "pagedown"
)
}
/// The keys of a shortcut, one cap each, in the platform's order: ⌃⌥⇧⌘
/// on macOS, Ctrl Alt Shift Win elsewhere. A numbered shortcut's key
/// shows as 1…9.
@@ -1041,8 +1055,19 @@ mod tests {
assert_eq!(check(new_host, "j"), Err(Refusal::NeedsModifier));
assert_eq!(check(new_host, "shift-j"), Err(Refusal::NeedsModifier));
assert_eq!(check(new_host, "shift-="), Err(Refusal::NeedsModifier));
assert_eq!(check(new_host, "shift-up"), Err(Refusal::NeedsModifier));
assert_eq!(check(new_host, "insert"), Err(Refusal::NeedsModifier));
assert_eq!(check(new_host, "f5"), Ok("f5".into()));
assert_eq!(check(new_host, "alt-j"), Ok("alt-j".into()));
for key in ["insert", "delete", "home", "end", "pageup", "pagedown"] {
let keys = format!("shift-{key}");
assert_eq!(check(new_host, &keys), Ok(keys), "{key}");
}
assert_eq!(
check(shortcut("terminal-paste"), "shift-insert"),
Ok("shift-insert".into())
);
// Taken by another shortcut working anywhere.
let terminal = shortcut("new-local-terminal");
assert_eq!(