Skip to content

Commit 3373635

Browse files
committed
fix(tui): 票据去掉双引号包裹,ESC退出间隔改为1s
1 parent 9b5deca commit 3373635

4 files changed

Lines changed: 5 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ sckt
160160
- `e`:进入编辑模式
161161
- `q`:退出编辑模式(中继 URL 会应用)
162162
- `h`:开关帮助
163-
- `Esc`3 秒内连按两次退出
163+
- `Esc`1 秒内连按两次退出
164164
- `c`:清空日志
165165

166166
## 配置与数据目录

tui/src/services/tunnel/runtime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub fn spawn_join(
4747
password: Option<String>,
4848
tx: mpsc::UnboundedSender<AppEvent>,
4949
) -> JoinHandle<()> {
50-
let ticket_str = ticket_str.trim().trim_matches('"').to_owned();
50+
let ticket_str = ticket_str.trim().to_owned();
5151
tokio::spawn(async move {
5252
let ticket: Ticket = match ticket_str.parse() {
5353
Ok(t) => t,

tui/src/state/events.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ pub(crate) fn handle_app_event(state: &mut AppState, event: AppEvent) {
2121
state.quit_pressed_at = None;
2222
state.ctx.tunnel = Some(tunnel);
2323

24-
let quoted = format!("\"{ticket}\"");
25-
if persist::clipboard_copy(&quoted) {
24+
if persist::clipboard_copy(&ticket) {
2625
state.add_log("票据已复制到剪贴板");
2726
}
2827
state.ticket = Some(ticket);
@@ -110,7 +109,7 @@ pub(crate) fn on_tick(state: &mut AppState) {
110109
state.tick = state.tick.saturating_add(1);
111110

112111
if let Some(prev) = state.quit_pressed_at
113-
&& Instant::now().duration_since(prev).as_secs() >= 3
112+
&& Instant::now().duration_since(prev).as_secs() >= 1
114113
{
115114
state.quit_pressed_at = None;
116115
}

tui/src/state/machine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub(crate) fn handle_lifecycle_esc(state: &mut AppState) -> Step {
5252
TunnelPhase::Idle => {
5353
let now = Instant::now();
5454
if let Some(prev) = state.quit_pressed_at
55-
&& now.duration_since(prev).as_secs() < 3
55+
&& now.duration_since(prev).as_secs() < 1
5656
{
5757
return Step::Exit;
5858
}

0 commit comments

Comments
 (0)