kovidgoyal / kitty

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

History doesn't show unicode chars correctly on my macOS, but it works fine on my linux #5511

Closed astroshot closed 2 years ago

astroshot commented 2 years ago

Describe the bug

History doesn't show unicode chars correctly on my macOS.

To Reproduce

I have configs:

map kitty_mod+h launch --stdin-source=@screen_scrollback --stdin-add-formatting less +G -R

But it works well on my Manjaro with KDE desktop, so any help?

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

图片

I'll paste pictures on my linux later if necessary

Environment details

Press Ctrl+Shift+F6 (cmd+option+comma on macOS) in kitty, to copy debug output about kitty and its
configuration to the clipboard and paste it here. 

On older versions of kitty, run kitty --debug-config instead
kitty 0.26.2 created by Kovid Goyal
Darwin lzMacbookPro.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101 arm64
ProductName:    macOS ProductVersion:   12.6 BuildVersion:      21G115
Frozen: True
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: /bin/zsh
Loaded config files:
  /Users/myname/.config/kitty/kitty.conf

Config options different from defaults:
bold_font                          Hack Nerd Font Mono Bold
bold_italic_font                   Hack Nerd Font Mono Bold Italic
copy_on_select                     clipboard
cursor_blink_interval              0.0
font_family                        Hack Nerd Font Mono
font_size                          13.0
italic_font                        Hack Nerd Font Mono Italic
macos_quit_when_last_window_closed True
macos_titlebar_color               -2
modify_font:
    cell_height 120%
    cell_width 100%
scrollback_pager_history_size      10485760
shell_integration                  frozenset({'no-cursor'})
strip_trailing_spaces              smart
tab_bar_style                      powerline
tab_powerline_style                slanted
tab_title_template                 {fmt.fg.red}{bell_symbol}{fmt.fg.cyan}[{index}]{activity_symbol}{fmt.fg.tab}{title[title.rfind('/')+1:]}
term                               xterm-256color
window_border_width                (1.0, 'px')
window_padding_width               FloatEdges(left=1.0, top=0, right=1.0, bottom=0)
Added shortcuts:
        opt+1 <E2><86><92>  goto_tab 1
        opt+2 <E2><86><92>  goto_tab 2
        opt+3 <E2><86><92>  goto_tab 3
        opt+4 <E2><86><92>  goto_tab 4
        opt+5 <E2><86><92>  goto_tab 5
        opt+6 <E2><86><92>  goto_tab 6
        opt+7 <E2><86><92>  goto_tab 7
        opt+8 <E2><86><92>  goto_tab 8
        opt+9 <E2><86><92>  goto_tab 9
        opt+left <E2><86><92>  send_text all \x01
        opt+right <E2><86><92>  send_text all \x05
        shift+left <E2><86><92>  previous_tab
        shift+right <E2><86><92>  next_tab
Changed shortcuts:
        kitty_mod+h <E2><86><92>  launch --stdin-source=@screen_scrollback --stdin-add-formatting less +G -R
        kitty_mod+left <E2><86><92>  move_tab_backward
        kitty_mod+right <E2><86><92>  move_tab_forward
Colors:
        active_tab_background              #586e75
        active_tab_foreground              #eee8d5
        background                         #002b36
        color0                             #586e75
        color1                             #d01b24
        color10                            #50ee84
        color11                            #b17e28
        color12                            #178dc7
        color13                            #e14d8e
        color14                            #00b29e
        color15                            #fcf4dc
        color2                             #6bbe6c
        color3                             #a57705
        color4                             #2075c7
        color5                             #c61b6e
        color6                             #259185
        color7                             #e9e2cb
        color8                             #006388
        color9                             #f4153b
        cursor                             #93a1a1
        cursor_text_color                  #002b36
        foreground                         #9bc1c2
        inactive_tab_background            #073642
        inactive_tab_foreground            #586e75
        mark1_background                   #000000
        mark1_foreground                   #ffff00
        mark2_background                   #000000
        mark2_foreground                   #ffff00
        mark3_background                   #000000
        mark3_foreground                   #ffff00
        selection_background               #657b83
        selection_foreground               #001e26

Important environment variables seen by the kitty process:
        PATH                                /Applications/kitty.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin
        LANG                                zh_AL.UTF-8
        SHELL                               /bin/zsh
        USER                                myname

Additional context Try to reproduce the problem with kitty --config NONE if you cannot then post a minimal kitty.conf that reproduces the problem. If the problem involves interaction with some other terminal program post a minimal config for that program to reproduce the problem as well.

kovidgoyal commented 2 years ago

Works fine on my macOS. Check that you are using an up-to-date less, IIRC macOS ships with an old/buggy one. Also you can try changing LANG via env in kitty.conf to en_US.UTF-8 it may be that less does not support zh_AL.UTF-8

astroshot commented 2 years ago

Works fine on my macOS. Check that you are using an up-to-date less, IIRC macOS ships with an old/buggy one. Also you can try changing LANG via env in kitty.conf to en_US.UTF-8 it may be that less does not support zh_AL.UTF-8

@kovidgoyal Yes, it's strange that LANG=zh_AL.UTF-8. In zsh, LANG is en_US.UTF-8. It's ok after env LANG=en_US.UTF-8 is added to kitty.conf. Thanks~