kingToolbox / kingToolbox/WindTerm

Unsuccessful Execution of Keyboard Shortcut 'Enter'

Open
#1,811 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
32.3k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

I use a USB-to-serial connection to connect with my device. However, after powering off and then powering on my device, the session connection is closed. When I attempt to press the "Enter" key to reconnect the session, it results in an error "设备不识别此命令", which is translated to "The device does not recognize the command" in English. It seems to be an exception within the Windows operating system.

![image](https://github.com/kingToolbox/WindTerm/assets/14884294/f5db07d0-8742-4a96-b017-d6d4037b2389)

I have discovered the keymap for the "Enter" key and provided it below. After removing "&& terminal.activeView().sessionState == King.Unconnected," I can successfully reconnect the session by pressing the "Enter" key, despite the error message "The device does not recognize the command" being displayed. This leads me to believe that the bug in this scenario might be related to the sessionState, which may not be Unconnected but in another state.

Could you please assist me in resolving this issue by editing the keymaps file? Your help with this matter is greatly appreciated. Thank you.

{ "keys": "",
"modes": "remote",
"when": "window.isScope('terminal.view.text') && terminal.activeView().sessionState == King.Unconnected",
"action": "Terminal.ReconnectSession"
},

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the keymaps entry for the key in remote terminal mode and inspect how terminal.activeView().sessionState is evaluated after a USB-to-serial device is powered back on. Reproduce the reconnect attempt on Windows, then verify that pressing Enter reconnects the session without the reported command error.

Written by the indexing model from the issue text.

Assessment

Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.