zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
25.27k stars 1.18k forks source link

Arrow keys don't work in internal terminal #1797

Open bobpaw opened 4 years ago

bobpaw commented 4 years ago

Description of the problem or steps to reproduce

When I open the terminal with > term and run a program that uses curses, arrow keys aren't passed properly. For example, opening a man page or using less. This error only occurs when using a terminal emulator or any /dev/pts device. It doesn't occur when using /dev/tty devices.

Specifications

Commit hash: Version 2.0.6 OS: Debian buster (run in WSL2) Terminal: bash

bobpaw commented 4 years ago

Apparently it sends ESCA instead of ESC[A, based off less' search function. It also sends two ESC when you press it once.

zyedidia commented 4 years ago

This seems to be a WSL2 problem, not sure why it only happens there.

bobpaw commented 4 years ago

I disagree. I get the same error on Debian in virtualbox.

bobpaw commented 4 years ago

I don't get the error when running in tty1 on a linux box, but I do when running in the xfce Terminal emulator.