ink icon indicating copy to clipboard operation
ink copied to clipboard

Ink 4.4.x incorrectly detects backspace

Open cpendery opened this issue 2 years ago • 3 comments

On Windows, backspace is properly detected; however, on Linux backspace is detected as delete

Minimal reproducible example

import React from 'react';
import {render, useInput, Text} from 'ink';

function Input() {
	useInput((_, key) => {
		if (key.backspace) {
			console.log("backspace")
		}
		else if (key.delete) {
			console.log("delete")
		}
	});

	return (
		<Text>Example</Text>
	);
}

render(<Input />);

cpendery avatar Oct 24 '23 18:10 cpendery

Feel free to look into this and submit a PR.

vadimdemedes avatar Nov 11 '23 17:11 vadimdemedes

hello

loly213 avatar Nov 24 '23 05:11 loly213

The same thing happens on Mac.

nukeop avatar Jun 23 '24 11:06 nukeop