Ctrl+Shift+C (and Ctrl+C with a selection) send ^C instead of copying on Linux/Windows
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- frontend
調査の方向性
キー処理は lib/input-handler.ts の handleKeyDown にあり、現在は metaKey と KeyC の組み合わせだけを特別に扱い、既存の onCopyCallback に到達しています。issue の再現スニペットを実行し、ctrlKey と shiftKey を伴う keydown が依然として "\u0003" として onData に届くことを確認してください。完了条件は、Ctrl+Shift+C がコピーコールバックを呼び出し、PTY には何も送らないこと、そして Ctrl+C は選択範囲が存在する場合にのみコピーし、それ以外は従来どおり ^C を送ることです。Cmd+C の経路も従来どおり動作することを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Summary
On Linux and Windows there is no keyboard way to copy the terminal selection: Ctrl+Shift+C (the terminal copy chord everywhere on those platforms) is passed to the key encoder and sent to the PTY as ^C (0x03), and plain Ctrl+C with text selected also sends ^C. Only Cmd+C (macOS, event.metaKey && event.code === 'KeyC') triggers the copy path. In a shell this means the user selects text, presses the copy shortcut, and interrupts their running program.
Seen on [email protected]; main (lib/input-handler.ts) still only special-cases metaKey + KeyC.
Minimal reproduction
<div id="t"></div>
<script type="module">
import { init, Terminal } from 'ghostty-web';
await init();
const term = new Terminal();
term.open(document.getElementById('t'));
term.onData((d) => console.log(JSON.stringify(d)));
term.write('hello world');
term.select(0, 0, 5); // "hello"
console.log(term.getSelection()); // "hello"
term.focus();
term.element.dispatchEvent(new KeyboardEvent('keydown', { key: 'C', code: 'KeyC', ctrlKey: true, shiftKey: true, bubbles: true, cancelable: true }));
</script>
Actual: onData receives "\u0003"; the clipboard is untouched. Expected: the selection is copied and nothing is sent to the PTY (Ctrl+Shift+C), and ideally Ctrl+C copies instead of interrupting when a selection exists (xterm.js users get this from attachCustomKeyEventHandler; Windows Terminal and GNOME Terminal behave this way).
Suggested fix
In handleKeyDown, treat (ctrlKey && shiftKey && code === 'KeyC') as copy using the existing onCopyCallback (always swallow it, never forward ^C), and ctrlKey && !shiftKey && code === 'KeyC' as copy when onCopyCallback() reports a selection.
Found while evaluating ghostty-web as a PTY renderer for https://github.com/erisera-code/clawser; the host currently works around it with attachCustomKeyEventHandler.
- 主要言語
- TypeScript
- スター
- 3k
- フォーク
- 183
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/ghostty-web のほかの issue
-
buffer translateToString()/getChars() return '' for empty cells, collapsing cursor-positioned textオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
coder/ghostty-web#205 ·
-
Alt+<printable key> sends the bare key with no ESC prefix (readline/emacs/tmux meta bindings lost)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
coder/ghostty-web#203 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
coder/ghostty-web#199 ·
-
Public buffer getChars and translateToString truncate multi-codepoint graphemes対応中かも @schickling-assistant が 13 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
coder/ghostty-web#200 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
coder/ghostty-web#198 ·
coder/ghostty-web の issue をすべて見る
似ている issue
-
useFragment does not require `variables` when the fragment's variables type has required fieldsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
apollographql/apollo-client#13493 ·
メンテナーはふだん 1 日以内に返信
-
Custom hosts written as trailing-dot FQDNs (`host.local.`) aren't detected as local backends対応中かも @roboomp が今日担当しました。 オープンbug prio:p2 providers triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
can1357/oh-my-pi#15798 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
code-yeongyu/oh-my-openagent#10172 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
PDFCraftTool/pdfcraft#189 ·
-
Add the Yahoo chart API duplicate last-day row (yfinance#573) to incidents.md (about 1 hour)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンdata docs good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
pacocartones/market-data-sanity-checker#160 ·
メンテナーはふだん 1 日以内に返信