micro-editor / micro-editor/micro

Command+Arrows on mac

Open
#1,898 8 comments 4 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

When I use zsh or nano, I can do command+left or command+right to place the cursor at the start or end of the line respectively (this works in all observable cases). I believe this is the "normal" behavior for macOS text editing as it seems to be the case for all apps.

Yet this does not seem to work in micro, when I do command+left, the cursor will go to the start of the line, but it will also select that text. While when I do command+right, it opens the micro command input (as if I pressed control+e).

I know micro remaps command to control on macOS as stated in the readme, but I can't use control-left and control-right instead because those are set (by default) to switching between different desktops/full screen windows through mission control. So I'm wondering if I'm missing the way to fix this issue (perhaps by letting micro take whatever key combination the terminal is giving it), or if this isn't supported at all by micro.

Specifications

I'm using iTerm 2 with the "Natural Text Editing" key mapping, which sets

  • command+left: Send Hex Codes 0x1
  • command+right: Send Hex Codes 0x5

Commit hash: 5044ccf (v2.0.7)
OS: macOS Catalina 10.15.7
Terminal: iTerm2 v3.3.12

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 issue in micro with iTerm2's Natural Text Editing mappings on macOS, then trace how the editor handles the reported 0x1 and 0x5 input sequences. Done means Command+Left and Command+Right move to the line boundaries without selecting text or opening the command input.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.