Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C-backspace = "delete_word_backward" doesn't work, should be fixed in Crossterm 0.25 #3725

Closed
David-Else opened this issue Sep 6, 2022 · 1 comment · Fixed by #4939
Closed
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug E-help-wanted Call for participation: Extra attention is needed

Comments

@David-Else
Copy link
Contributor

David-Else commented Sep 6, 2022

Summary

In my config:

C-backspace = "delete_word_backward"

Does nothing in Kitty and Gnome Terminal. Crossterm 0.25 added functional key codes from the Kitty keyboard protocol https://github.com/crossterm-rs/crossterm/releases/tag/0.25 , so it should at least work for Kitty. @groves I think they need to be enabled?

(Works in Neovim with vim.keymap.set('i', '<C-H>', '<C-W>'))

Platform

Linux

Terminal Emulator

Kitty

Helix Version

22.08.1

@David-Else David-Else added the C-bug Category: This is a bug label Sep 6, 2022
@archseer
Copy link
Member

archseer commented Sep 6, 2022

Should be easy to do:

use std::io::{Write, stdout};
use crossterm::execute;
use crossterm::event::{
    KeyboardEnhancementFlags,
    PushKeyboardEnhancementFlags,
    PopKeyboardEnhancementFlags
};

let mut stdout = stdout();

execute!(
    stdout,
    PushKeyboardEnhancementFlags(
        KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES
    )
);

// ...

execute!(stdout, PopKeyboardEnhancementFlags);

But not sure if crossterm does all the detection needed for progressive enhancement: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#detection-of-support-for-this-protocol

Windows implementation seems to always return an error too so we'd need to specially handle that by ignoring the error

@the-mikedavis the-mikedavis added E-help-wanted Call for participation: Extra attention is needed A-helix-term Area: Helix term improvements labels Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug E-help-wanted Call for participation: Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants