micro-editor / micro-editor/micro

showkey retrieves binding for exact string instead of key combination

Open
#1,796 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
29.6k
Forks
1.4k
Avg merge
2d 18h
Merged PRs (30d)
10

Description

Description of the problem or steps to reproduce

I think an example will explain the problem pretty well:

> showkey Ctrl-V
Ctrl-V has no binding
> showkey CtrlV
CtrlV has no binding
> showkey ctrl-v
ctrl-v has no binding
> showkey ctrlV
ctrlV has no binding
> showkey C-V
C-V has no binding
> showkey Ctrl-v
Paste

What I would expect from > showkey is that it would tell me what a particular key combination is bound to. What actually happens is, if I don't guess the exact key string (so about 80% of the time), > showkey says there is no binding, despite that key combination actually being bound. This means I have to try at least 6 different strings for each key combination I want to query, and even then I'm not entirely sure if they key is actually unbound.

As an additional observation, I can type anything into the command, like > showkey as8df7asf4, and it will reply that as8df7asf4 has no binding, without checking if that's a recognised key combination. By itself that's of course benign, but it might help illustrate the underlying problem.

Specifications

Version: 2.0.6
Commit hash: 60846f5
Compiled on July 03, 2020
OS: Manjaro KDE
Terminal: Konsole

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the showkey Ctrl-V and showkey Ctrl-v examples from the issue, then trace the showkey command's key-binding lookup and how it handles unrecognized strings. Done means equivalent key-combination spellings resolve to the same binding, while unknown input is distinguished from an unbound recognized key.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.