Skip to content

Commit e7ac8be

Browse files
committed
Release desktop 1.8.2
1 parent 0d7ac05 commit e7ac8be

6 files changed

Lines changed: 34 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
## [1.8.2] - 2026-06-17
8+
9+
### Fixed
10+
11+
- Added right-click copy for selected desktop terminal text, clearing the selection after copying so Windows users can copy terminal output without sending `Ctrl+C` to the running process.
12+
713
## [1.8.1] - 2026-06-16
814

915
### Changed

CHANGELOG.zh-CN.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
## [Unreleased]
66

7+
## [1.8.2] - 2026-06-17
8+
9+
### 修复
10+
11+
- 桌面端终端新增选中文本后右键复制,并在复制后取消选区,Windows 用户复制终端输出时不再需要使用可能中断进程的 `Ctrl+C`
12+
713
## [1.8.1] - 2026-06-16
814

915
### 调整

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/desktop/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "codux"
3-
version = "1.8.1"
3+
version = "1.8.2"
44
edition = "2024"
55

66
[dependencies]

apps/desktop/runtime/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "codux-runtime"
3-
version = "1.8.1"
3+
version = "1.8.2"
44
edition = "2024"
55

66
[dependencies]

apps/desktop/src/terminal/view.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,7 @@ impl TerminalView {
248248

249249
fn on_key_down(&mut self, event: &KeyDownEvent, window: &mut Window, cx: &mut Context<Self>) {
250250
if is_copy_keystroke(&event.keystroke) {
251-
if let Some(text) = self.selected_text(cx) {
252-
cx.write_to_clipboard(ClipboardItem::new_string(text));
251+
if self.copy_selected_text(cx) {
253252
cx.stop_propagation();
254253
cx.notify();
255254
return;
@@ -328,6 +327,15 @@ impl TerminalView {
328327
return;
329328
}
330329

330+
if event.button == MouseButton::Right && self.copy_selected_text(cx) {
331+
self.selection.lock().clear();
332+
self.model.update(cx, |model, _| model.clear_selection());
333+
self.selection_autoscroll = None;
334+
cx.stop_propagation();
335+
cx.notify();
336+
return;
337+
}
338+
331339
if self.should_report_mouse(event.modifiers.shift, cx) {
332340
if let Some(point) = point {
333341
self.send_mouse_report(
@@ -733,6 +741,14 @@ impl TerminalView {
733741
selection_point_from_cell(point, &content)
734742
}
735743

744+
fn copy_selected_text(&self, cx: &mut App) -> bool {
745+
let Some(text) = self.selected_text(cx) else {
746+
return false;
747+
};
748+
cx.write_to_clipboard(ClipboardItem::new_string(text));
749+
true
750+
}
751+
736752
fn set_marked_text(&mut self, text: String, cx: &mut Context<Self>) {
737753
if text.is_empty() {
738754
self.clear_marked_text(cx);

0 commit comments

Comments
 (0)