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

On alacritty ncinput_alt_p never returns true #2735

Open
endofunky opened this issue Oct 28, 2023 · 1 comment
Open

On alacritty ncinput_alt_p never returns true #2735

endofunky opened this issue Oct 28, 2023 · 1 comment
Assignees
Labels
bug Something isn't working input readin' dem bytes
Milestone

Comments

@endofunky
Copy link

I've noticed that on alacritty the ncinput_alt_p and ncinput_meta_p functions never return 1 when the alt key is pressed. The ncinput.alt value, however, is set correctly and indicates that alt was pressed.

In other terminal emulators that I've tried this is working correctly.

I'm not sure if I'm missing something here, but if not, is there a known workaround that doesn't require using deprecated APIs? I'm using the rust wrapper library and it doesn't expose the underlying ncinput struct from what I can tell.

Small example to reproduce:

#include <notcurses/notcurses.h>

int main(void)
{
	ncinput ni;

	struct notcurses* nc = notcurses_core_init(NULL, NULL);
	struct ncplane* plane = notcurses_stdplane(nc);

	while (notcurses_get_blocking(nc, &ni) != -1) {
		if (ni.evtype == NCTYPE_RELEASE)
			continue;

		ncplane_printf_yx(plane, 0, 0, "alt_p: %d", ncinput_alt_p(&ni));
		ncplane_printf_yx(plane, 1, 0, "meta_p: %d", ncinput_meta_p(&ni));
		ncplane_printf_yx(plane, 2, 0, "ncinput.alt: %d", ni.alt);
		notcurses_render(nc);
	}

	notcurses_stop(nc);

	return 0;
}

Additional info

notcurses 3.0.9
alacritty 0.12.3

$ export | egrep 'LANG|LC_CTYPE|TERM
LANG=en_GB.UTF-8
LANGUAGE=en_GB.UTF-8
TERM=alacritty-direct
TERMINFO_DIRS=/home/ef/.nix-profile/share/terminfo:/home/ef/.local/state/nix/profile/share/terminfo:/etc/profiles/per-user/ef/share/terminfo:/nix/var/nix/profiles/default/share/terminfo:/run/current-system/sw/share/terminfo
@endofunky endofunky added the bug Something isn't working label Oct 28, 2023
@dankamongmen
Copy link
Owner

great bug report, thanks a lot! i can't spend much time on notcurses these days, but i might be doing so soon, and i'll definitely want to get to this.

@dankamongmen dankamongmen self-assigned this Oct 28, 2023
@dankamongmen dankamongmen added the input readin' dem bytes label Oct 28, 2023
@dankamongmen dankamongmen added this to the 3.1.0 milestone Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working input readin' dem bytes
Projects
None yet
Development

No branches or pull requests

2 participants