kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
24.36k stars 979 forks source link

The first korean character typed gets decomposed #7947

Closed rpopic2 closed 2 weeks ago

rpopic2 commented 3 weeks ago

Describe the bug The first korean character type gets decomposed. e.g. Typing 감 results in ㄱㅏㅁ.

The next following character you type is composed correctly. e.g. Typing 감자 results in ㄱㅏㅁ자

Typing backspace after typing a jaso and typing the whole character, results in correctly composed character. e.g. Typing ㄱ\<backspace>감자 results in 감자

*A Korean character is composed of one or more jaso.

It is not a good experience as I have to keep pressing backspace after I change to Korean..

To Reproduce Steps to reproduce the behavior:

  1. Change input method to Korean
  2. Type 감자(rkawk in english keyboard)
  3. The first character is decoposed as ㄱㅏㅁ자.

Screenshots If applicable, add screenshots to help explain your problem.

Screenshot 2024-10-07 at 10 02 12 AM

Environment details

kitty 0.36.2 (15ac33a058) created by Kovid Goyal
Darwin macbook-air.local 23.6.0 Darwin Kernel Version 23.6.0: Wed Jul 31 20:53:05 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T8112 arm64
ProductName:        macOS ProductVersion:       14.7 BuildVersion:      23H124
OpenGL: '4.1 Metal - 88.1' Detected version: 4.1
Frozen: True
Fonts:
  medium: JetBrainsMono-Regular: /Users/rpopic2/Library/Fonts/JetBrainsMono[wght].ttf
          Features: ()
    bold: JetBrainsMonoRoman-SemiBold: /Users/rpopic2/Library/Fonts/JetBrainsMono[wght].ttf
          Features: ()
  italic: JetBrainsMono-Regular: /Users/rpopic2/Library/Fonts/JetBrainsMono[wght].ttf
          Features: ()
      bi: JetBrainsMonoRoman-SemiBold: /Users/rpopic2/Library/Fonts/JetBrainsMono[wght].ttf
          Features: ()
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /opt/homebrew/Cellar/bash/5.2.32/bin/bash
Loaded config files:
  /Users/rpopic2/.config/kitty/kitty.conf

Config options different from defaults:
active_tab_font_style      (False, False)
cursor_blink_interval      (0.0, kitty.options.utils.EasingFunction(), kitty.options.utils.EasingFunction())
disable_ligatures          2
font_family                JetBrains Mono Light
font_size                  24.0
initial_window_height      (27, 'cells')
initial_window_width       (82, 'cells')
macos_show_window_title_in none
mouse_hide_wait            0.5
remember_window_size       False
shell_integration          frozenset({'no-cursor'})
sync_to_monitor            False
tab_bar_style              powerline
tab_powerline_style        round
tab_separator              
Added shortcuts:
    shift+cmd+t →  new_tab_with_cwd
Removed shortcuts:
    cmd+, →  edit_config_file
    cmd+enter →  new_window
    cmd+h →  hide_macos_app
    cmd+k →  clear_terminal to_cursor active
    cmd+m →  minimize_macos_window
    cmd+n →  new_os_window
    cmd+q →  quit
    cmd+t →  new_tab
    cmd+w →  close_tab
    ctrl+cmd+, →  load_config_file
    ctrl+cmd+f →  toggle_fullscreen
    opt+cmd+h →  hide_macos_other_apps
    opt+cmd+r →  clear_terminal reset active
    opt+cmd+s →  toggle_macos_secure_keyboard_entry
    shift+cmd+/ →  open_url https://sw.kovidgoyal.net/kitty/
    shift+cmd+[ →  previous_tab
    shift+cmd+] →  next_tab
    shift+cmd+d →  close_window
    shift+cmd+w →  close_os_window
Changed shortcuts:
    kitty_mod+t →  new_tab_with_cwd
Colors:
    active_border_color        #8da101   
    active_tab_background      #fffbef   
    active_tab_foreground      #5c6a72   
    background                 #fffbef   
    bell_border_color          #f57d26   
    color0                     #708089   
    color1                     #f85552   
    color10                    #93b259   
    color11                    #dfa000   
    color12                    #3a94c5   
    color13                    #df69ba   
    color14                    #35a77c   
    color15                    #a6b0a0   
    color2                     #8da101   
    color3                     #dfa000   
    color4                     #3a94c5   
    color5                     #df69ba   
    color6                     #35a77c   
    color7                     #939f91   
    color8                     #829181   
    color9                     #e66868   
    cursor                     #5c6a72   
    cursor_text_color          #f8f5e4   
    foreground                 #5c6a72   
    inactive_border_color      #bec5b2   
    inactive_tab_background    #f2efdf   
    inactive_tab_foreground    #939f91   
    mark1_background           #3a94c5   
    mark1_foreground           #fffbef   
    mark2_background           #d3c6aa   
    mark2_foreground           #fffbef   
    mark3_background           #df69ba   
    mark3_foreground           #fffbef   
    selection_background       #f0f2d4   
    selection_foreground       #829181   
    tab_bar_background         #f8f5e4   
    url_color                  #3a94c5   

Important environment variables seen by the kitty process:
    PATH                                /Applications/kitty.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin
    LANG                                en_US.UTF-8
    SHELL                               /opt/homebrew/Cellar/bash/5.2.32/bin/bash
    USER                                rpopic2

Additional context Reproducable with kitty --config NONE

kovidgoyal commented 2 weeks ago

kitty doesn't handle input methods that's done by the system, you can run kitty with --debug-input and you will see what input the system sends it. I am guessing that the IME engine on your system is doing this for some reason. I have no idea why. The log from debug-input will show exactly what is happening.

rpopic2 commented 2 weeks ago

The log shows ㄱㅏㅁ자, which is decoposed character. So it appears to be it's the IME engine's problem? However any other apps, includeing other terminal emulators does not have this problem. I'm only having trouble with kitty. What could be the problem..?

kovidgoyal commented 2 weeks ago

No idea, I dont know a lot about IME engines on macOS. If you want to investigate yourself, the relevant code is in glfw/cocow_window.m look for keyDown() function

rpopic2 commented 2 weeks ago

Thanks! I'll take a look :)