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

macOS: unexpected characters get deleted when using backspace in Pinyin input method #1606

Closed
VickyJin opened this issue Sep 29, 2018 · 55 comments · Fixed by #3264
Closed

macOS: unexpected characters get deleted when using backspace in Pinyin input method #1606

VickyJin opened this issue Sep 29, 2018 · 55 comments · Fixed by #3264

Comments

@VickyJin
Copy link

Which operating system does the issue occur on? macOS 10.13

When input Chinese characters, if I use backspace to remove some letters ( as part of the Pinyin structure), it will get the characters which are just before the cursor of alacritty deleted (not what I intend to do).
I have tested it with the input method in the gifs and macOS's default Pinyin input methods, and with the fresh installed alacritty on other people's maxOS (also 10.13), all reproduced the case.

gifs for different behaviors of alacritty and iTerm2.
alacritty
iterm2

@zhaozg
Copy link

zhaozg commented Sep 29, 2018

Same on head

@chrisduerr
Copy link
Member

Looks like the intended behavior is that while the popup is open, the backspace key should be ignored? Is that correct?

@VickyJin
Copy link
Author

@chrisduerr seems the common behavior (what I see from the UI) is: when input "ceshi" with Pinyin input method, there are actual letters (with underline) in the software's box (not only in the popup) waiting for further instructions. Notes/Paper/Browser/search bars of other softwares on macOS work like this. Haven't looked into the key events...

@chrisduerr
Copy link
Member

This is related to #1613 and a solution to that issue would probably also solve this one.

@weihanglo
Copy link

Same here on macOS Mojave 10.14.

oct-17-2018 13-18-22

I would like to help resolving this issue. @chrisduerr Would you mind to shed some light on it?

@coderhwz
Copy link

Is there any solution ?

@chrisduerr
Copy link
Member

@coderhwz If you want to see a solution to this issue, your best choice is to try and look into this yourself. I'm always happy to help you out if you're interested at resolving this problem.

However as long as an issue is still open, there is no solution. Rather than commenting, which sends a notification to everyone watching the repository, I'd recommend subscribing to the issue for updates.

@coderhwz
Copy link

I think winit should not capture delete events on the input method

@Double1996
Copy link

Is there any solution ?

so how to do ?

@taoso
Copy link

taoso commented Jun 16, 2019

Is there any solution?

@kuhnpeng
Copy link

Which operating system does the issue occur on? macOS 10.13

When input Chinese characters, if I use backspace to remove some letters ( as part of the Pinyin structure), it will get the characters which are just before the cursor of alacritty deleted (not what I intend to do).
I have tested it with the input method in the gifs and macOS's default Pinyin input methods, and with the fresh installed alacritty on other people's maxOS (also 10.13), all reproduced the case.

gifs for different behaviors of alacritty and iTerm2.
alacritty
iterm2

Hi,,When I input the chinese words. it's show messy code. like this <00e4><00bd><00a0>.How to Input the Chinese characters in alacritty?

@wangfenjin
Copy link

A workaround in macOS: hold command key when press backspace

@tyru
Copy link

tyru commented Aug 11, 2019

This occurs also in japanese input method which is installed by default.
(I was typing en<Space> and ↑ and ↓ keys but alacritty was handling keys even while preediting)
Screencast 2019-08-12 04 03 21

Please ignore keys while preediting (generally called "over-the-spot" ? I don't know macOS API and input method well though).
https://docs.oracle.com/cd/E19455-01/806-2914/6jc3mhd4h/index.html

And this is off-topic though, I can't input any japanese characters #1101

I'm using:

$ brew cask ls --versions alacritty
alacritty 0.3.3

This was referenced Aug 11, 2019
@aizigao
Copy link

aizigao commented Sep 2, 2019

same problem 😞

@chrisduerr chrisduerr added this to the Version 1.0 milestone Sep 2, 2019
@Frefreak
Copy link

same here.

@ngn999
Copy link

ngn999 commented Jan 13, 2020

it's 2020, no solution?

@chrisduerr
Copy link
Member

It's 2020, you should know that bumping issues over and over again just means there will be less work done fixing problems and more work handling issues.

If you're not satisfied with the priority of an issue, patches are always welcome and I'm happy to mentor anyone who's trying to help out.

@ngn999
Copy link

ngn999 commented Jan 29, 2020

It's 2020, you should know that bumping issues over and over again just means there will be less work done fixing problems and more work handling issues.

If you're not satisfied with the priority of an issue, patches are always welcome and I'm happy to mentor anyone who's trying to help out.

after adding some println!, I find the problem is Back (Backspace key), is a build-in binding, every time press Backspace key, Alacritty delete some input. To fix this issue, put

key_bindings:
  - { key: Back, action:  ReceiveChar}

into your configuration.

@dyxushuai
Copy link

@ngn999 awesome it's work for me

@chrisduerr
Copy link
Member

@ngn999 That's a very good catch, thanks for pointing it out. It seems like on macOS the ^? character is sent by default, making it so this binding is not actually required.

On Linux, the backspace is ^H by default so we have this binding to change things into ^?.

It seems like we should be able to remove this binding from macOS and just use it for Windows/Linux and that should fix this issue? Though I don't know if it is required on Windows, if anyone is willing to help, please let me know.

@chrisduerr
Copy link
Member

Also if someone has a Rust toolchain installed, please let me know if this works: #3264.

@chrisduerr
Copy link
Member

Reported upstream in rust-windowing/winit#1452.

chrisduerr added a commit that referenced this issue Feb 10, 2020
This reverts commit 7f4dce2.

Originally it was assumed that macOS always sends the \x7f on backspace
anyways, however this is not true. It seems like the character on
backspace can change even within the same terminal session, so we need
to have our own binding to reliably set the correct binding.

A solution for #1606 should be implemented in cooperation with winit.
@ccoolsnake

This comment has been minimized.

@BTBMan

This comment has been minimized.

roychoo pushed a commit to roychoo/alacritty that referenced this issue Apr 19, 2020
roychoo pushed a commit to roychoo/alacritty that referenced this issue Apr 19, 2020
This reverts commit 7f4dce2.

Originally it was assumed that macOS always sends the \x7f on backspace
anyways, however this is not true. It seems like the character on
backspace can change even within the same terminal session, so we need
to have our own binding to reliably set the correct binding.

A solution for alacritty#1606 should be implemented in cooperation with winit.
@laishulu

This comment has been minimized.

@LittleKey

This comment has been minimized.

@chrisduerr
Copy link
Member

but kitty press keyboard input was too slow for me. how do you fix it?

That's probably best discussed on Kitty's issue tracker. ;)

I have no problem with using alternative emulators if they work better for you, but please keep the responses on topic for Alacritty, otherwise it's going to be much more difficult to actually follow the conversation to fix things when the time has come.

@Cyperwu
Copy link

Cyperwu commented Sep 21, 2020

It's 2020, you should know that bumping issues over and over again just means there will be less work done fixing problems and more work handling issues.
If you're not satisfied with the priority of an issue, patches are always welcome and I'm happy to mentor anyone who's trying to help out.

after adding some println!, I find the problem is Back (Backspace key), is a build-in binding, every time press Backspace key, Alacritty delete some input. To fix this issue, put

key_bindings:
  - { key: Back, action:  ReceiveChar}

into your configuration.

To be clear,this only fixes the backspace key, but @tyru 's issue about the arrow keys still exists.

@hongjiang
Copy link

It's 2020, you should know that bumping issues over and over again just means there will be less work done fixing problems and more work handling issues.
If you're not satisfied with the priority of an issue, patches are always welcome and I'm happy to mentor anyone who's trying to help out.

after adding some println!, I find the problem is Back (Backspace key), is a build-in binding, every time press Backspace key, Alacritty delete some input. To fix this issue, put

key_bindings:
  - { key: Back, action:  ReceiveChar}

into your configuration.

in vim editor, this binding cause backspace not work

@czdm75
Copy link

czdm75 commented Feb 5, 2021

It's 2020, you should know that bumping issues over and over again just means there will be less work done fixing problems and more work handling issues.
If you're not satisfied with the priority of an issue, patches are always welcome and I'm happy to mentor anyone who's trying to help out.

after adding some println!, I find the problem is Back (Backspace key), is a build-in binding, every time press Backspace key, Alacritty delete some input. To fix this issue, put

key_bindings:
  - { key: Back, action:  ReceiveChar}

into your configuration.

in vim editor, this binding cause backspace not work

I found that backspace key produces ^H rather than ^? after typing with Chinese IME, maybe you can change your vim config to adapt that.

@kense-lab
Copy link

kense-lab commented Feb 5, 2021

It's 2020, you should know that bumping issues over and over again just means there will be less work done fixing problems and more work handling issues.
If you're not satisfied with the priority of an issue, patches are always welcome and I'm happy to mentor anyone who's trying to help out.

after adding some println!, I find the problem is (Backspace key), is a build-in binding, every time press Backspace key, Alacritty delete some input. To fix this issue, putBack

key_bindings:
  - { key: Back, action:  ReceiveChar}

into your configuration.

Adding configuration one by one will result in the backspace key not working in Tmux.

@epheien

This comment has been minimized.

@cstsunfu
Copy link

It's 2020, you should know that bumping issues over and over again just means there will be less work done fixing problems and more work handling issues.
If you're not satisfied with the priority of an issue, patches are always welcome and I'm happy to mentor anyone who's trying to help out.

after adding some println!, I find the problem is Back (Backspace key), is a build-in binding, every time press Backspace key, Alacritty delete some input. To fix this issue, put

key_bindings:
  - { key: Back, action:  ReceiveChar}

into your configuration.

This configures only fixes the origin issue, but when I use Tmux or Neovim terminal this solution will make backspace not working.

@ngn999
Copy link

ngn999 commented Feb 21, 2022

@cstsunfu it works on the last version alacritty + tmux, maybe alacritty fix something.

@dyxushuai
Copy link

@ngn999 It dosnt work for me without set - { key: Back, action: ReceiveChar} and the version is 0.10.1

@ngn999
Copy link

ngn999 commented Feb 22, 2022

@dyxushuai yeah, you should set - { key: Back, action: ReceiveChar}

@chrisduerr any update on this issue? what can I do to help?

@kchibisov
Copy link
Member

I'm working on it, but the majority of it is outside of alacritty. If you point this patch to proper winit branch, it'll make it work on macOS. For now only Wayland works...

@ngn999 #5790

specv added a commit to specv/nix-dotfiles that referenced this issue May 16, 2022
[macOS: unexpected characters get deleted when using backspace in Pinyin input method](alacritty/alacritty#1606)
@kchibisov
Copy link
Member

Fixed with latest commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.