My ZSH Is Broken Because of Gvim


After I type gvim into ZSH, and terminate it as it does not work. All the output become gibberish. It looks like the following.

A normal ls output should be clean and in proper indentation, like this.

This problem happening everytime I try to use gvim. However, if I close the console and reopen it, everything back to normal and repeat all the bad things once I try to start gvim again. Vim is working correctly, but gvim broke by zsh.

Could you help me with gvim? Zsh is working as long as I don’t launch gvim. I reinstall it several times and use git to compile vim locally. But none of those work. I also search online and slightly change my ~/.vimrc, but it does not work too.

Thanks for your time and consideration! I am novice to linux, but I will try my best to understand your instructions and advice. Thanks again for your patience!



inxi -Fazy

  Kernel: 5.15.5-1-rt22-MANJARO x86_64 bits: 64 compiler: gcc v: 11.1.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.15-rt-x86_64
    root=UUID=18203687-2d01-49e9-b192-df811ffea029 rw quiet apparmor=1
    security=apparmor udev.log_priority=3
  Desktop: KDE Plasma 5.23.4 tk: Qt 5.15.2 wm: kwin_x11 vt: 1 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
  Type: Laptop System: MECHREVO product: S2 Series v: N/A
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: MECHREVO model: SW1 serial: <superuser required>
    UEFI: American Megatrends v: SC1M.07 date: 03/18/2020
  ID-1: BAT0 charge: 50.2 Wh (100.0%) condition: 50.2/50.2 Wh (100.0%)
    volts: 12.4 min: 11.4 model: N/A type: Unknown serial: <filter>
    status: Not charging
  Info: model: Intel Core i7-10510U bits: 64 type: MT MCP
    arch: Comet/Whiskey Lake note: check family: 6 model-id: 0x8E (142)
    stepping: 0xC (12) microcode: 0xEA
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB
    L3: 8 MiB desc: 1x8 MiB
  Speed (MHz): avg: 1462 high: 3155 min/max: 400/4900 scaling:
    driver: intel_pstate governor: powersave cores: 1: 3155 2: 2508 3: 1699
    4: 1140 5: 800 6: 800 7: 800 8: 800 bogomips: 36799
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl and seccomp
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Enhanced IBRS, IBPB: conditional, RSB filling
  Type: srbds mitigation: TSX disabled
  Type: tsx_async_abort status: Not affected
  Device-1: Intel CometLake-U GT2 [UHD Graphics] driver: i915 v: kernel
    bus-ID: 00:02.0 chip-ID: 8086:9b41 class-ID: 0300
  Device-2: NVIDIA GP107M [GeForce MX350] driver: N/A alternate: nouveau
    bus-ID: 01:00.0 chip-ID: 10de:1c94 class-ID: 0302
  Device-3: Realtek USB Camera type: USB driver: uvcvideo bus-ID: 1-2:2
    chip-ID: 0bda:0568 class-ID: 0e02 serial: <filter>
  Display: x11 server: X.Org compositor: kwin_x11 driver:
    loaded: modesetting alternate: fbdev,vesa display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2")
    s-diag: 582mm (22.9")
  Monitor-1: eDP-1 res: 1920x1080 hz: 60 dpi: 158
    size: 309x173mm (12.2x6.8") diag: 354mm (13.9")
  Message: Unable to show advanced data. Required tool glxinfo missing.
  Device-1: Intel Comet Lake PCH-LP cAVS driver: snd_hda_intel v: kernel
    alternate: snd_soc_skl,snd_sof_pci_intel_cnl bus-ID: 00:1f.3
    chip-ID: 8086:02c8 class-ID: 0403
  Sound Server-1: ALSA v: k5.15.5-1-rt22-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.19 running: no
  Sound Server-3: PulseAudio v: 15.0 running: yes
  Sound Server-4: PipeWire v: 0.3.40 running: yes
  Device-1: Intel Comet Lake PCH-LP CNVi WiFi driver: iwlwifi v: kernel
    bus-ID: 00:14.3 chip-ID: 8086:02f0 class-ID: 0280
  IF: wlo1 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    driver: r8169 v: kernel port: 3000 bus-ID: 02:00.0 chip-ID: 10ec:8168
    class-ID: 0200
  IF: enp2s0 state: down mac: <filter>
  IF-ID-1: vmnet1 state: unknown speed: N/A duplex: N/A mac: <filter>
  IF-ID-2: vmnet8 state: unknown speed: N/A duplex: N/A mac: <filter>
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) type: USB
    driver: btusb v: 0.8 bus-ID: 1-10:4 chip-ID: 8087:0aaa class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 1 state: up address: see --recommends
  Local Storage: total: 709.66 GiB used: 81.39 GiB (11.5%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: ForeseSU04Ge model: S50AF512GB
    size: 476.94 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 117B scheme: GPT
  ID-2: /dev/sdb maj-min: 8:16 type: USB model: MS 256GB USB3.0
    size: 232.72 GiB block-size: physical: 4096 B logical: 4096 B type: N/A
    serial: <filter> rev: 1100 scheme: MBR
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
  ID-1: / raw-size: 210.49 GiB size: 206.12 GiB (97.93%)
    used: 79.94 GiB (38.8%) fs: ext4 dev: /dev/sda2 maj-min: 8:2
  ID-2: /boot/efi raw-size: 512 MiB size: 511 MiB (99.80%)
    used: 45.7 MiB (8.9%) fs: vfat dev: /dev/sda1 maj-min: 8:1
  Alert: No swap data was found.
  System Temperatures: cpu: 80.0 C pch: 44.0 C mobo: N/A
  Fan Speeds (RPM): N/A
  Processes: 310 Uptime: 11m wakeups: 1 Memory: 15.51 GiB
  used: 2.61 GiB (16.8%) Init: systemd v: 249 tool: systemctl Compilers:
  gcc: 11.1.0 clang: 13.0.0 Packages: pacman: 1615 lib: 436 flatpak: 0
  Shell: Zsh v: 5.8 running-in: konsole inxi: 3.3.11


uname -a

Linux yubo-s2series 5.15.5-1-rt22-MANJARO #1 SMP PREEMPT_RT Wed Dec 1 16:28:32 CET 2021 x86_64 GNU/Linux


cat /etc/shells       
# Pathnames of valid login shells.
# See shells(5) for details.

env | grep "SHELL"    
echo $0     


vim --version

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Dec 20 2021 21:20:14)
包含补丁: 1-3863
编译者 yubo@yubo-s2series
巨型版本 带 X11-Athena 图形界面。  可使用(+)与不可使用(-)的功能:
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       -tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
+balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
+browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     -perl              +title
+channel           +ipv6              +persistent_undo   +toolbar
+cindent           +job               +popupwin          +user_commands
+clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +virtualedit
+cmdline_hist      +langmap           -python            +visual
+cmdline_info      +libcall           -python3           +visualextra
+comments          +linebreak         +quickfix          +viminfo
+conceal           +lispindent        +reltime           +vreplace
+cryptv            +listcmds          +rightleft         +wildignore
+cscope            +localmap          -ruby              +wildmenu
+cursorbind        -lua               +scrollbind        +windows
+cursorshape       +menu              +signs             +writebackup
+dialog_con_gui    +mksession         +smartindent       +X11
+diff              +modify_fname      +sodium            +xfontset
+digraphs          +mouse             +sound             +xim
-dnd               +mouseshape        +spell             +xpm
-ebcdic            +mouse_dec         +startuptime       +xsmp_interact
+emacs_tags        +mouse_gpm         +statusline        +xterm_clipboard
+eval              -mouse_jsbterm     -sun_workshop      -xterm_save
+ex_extra          +mouse_netterm     +syntax            
+extra_search      +mouse_sgr         +tag_binary        
-farsi             -mouse_sysmouse    -tag_old_static    
     系统 vimrc 文件: "$VIM/vimrc"
     用户 vimrc 文件: "$HOME/.vimrc"
 第二用户 vimrc 文件: "~/.vim/vimrc"
      用户 exrc 文件: "$HOME/.exrc"
    系统 gvimrc 文件: "$VIM/gvimrc"
    用户 gvimrc 文件: "$HOME/.gvimrc"
第二用户 gvimrc 文件: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
        系统菜单文件: "$VIMRUNTIME/menu.vim"
         $VIM 预设值: "/usr/local/share/vim"
编译方式: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_ATHENA -O2 -fno-strength-reduce -Wall -Wno-deprecated-declarations -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 
链接方式: gcc -L/usr/local/lib -Wl,--as-needed -o vim -lXaw -lXmu -lXext -lXt -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -ldl -lm -ltinfo -lelf -lcanberra -lsodium -lacl -lattr -lgpm -ldl 
cat ~/.vimrc

set nocompatible              " be iMproved, required
filetype off                  " required
set backspace=indent,eol,start
set guifont=noto\\NotoSansMono-Light:s11

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" alternatively, pass a path where Vundle should install plugins
call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" add all your plugins here (note older versions of Vundle
" used Bundle instead of Plugin)

" All of your Plugins must be added before the following line
call vundle#end()            " required
Plugin 'vim-latex/vim-latex'
filetype plugin indent on    " required

" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
filetype plugin on

" OPTIONAL: This enables automatic indentation as you type.
filetype indent on

" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default file type back to tex
let g:tex_flavor='latex'

Try to uninstall gvim, then install vim.

The problem persists. Here is the command I executed.

 1312  sudo pacman -Rc gvim, vim, neovim, vim-runtime
 1313  sudo pacman -Sy vim

The same error message persist, after I type vim, and then :gui. It still say cannot found fonts.

Warning: Missing charsets in String to FontSet conversion
E665: 无法启动图形界面,找不到有效的字体
请按 ENTER 或其它命令继续
E852: The child process failed to start the GUIXIO:  fatal IO error 22 (无效的参数) on X server ":0"
      after 9 requests (9 known processed) with 0 events remaining.
  1. Test:
    Try to run mv ~/.vimrc ~/.vimrc_backUp.
    Create a new empty file touch ~/.vimrc, is the issue gone?

  2. Test:
    Switch zsh to bash, what happens, the same issue?

This seems relevant: “Warning: Missing charsets in String to FontSet conversion” – how to resolve the xclock warning message – The Geek Diary

Is it Chinese?

I move vimrc and created an empty placeholder on vimrc. Nothing changed.

For change the shell into bash. I make those two changes:

chsh -s /bin/bash
I open konsole, and change the command into bash.

And the output of bash and $0 are both /bin/bash now. However, the problem persist. Additionally, when I use bash to run gvim, the konsole freezed with gvim. Same error print to screen after a while.

Here is output of loacle. And, yes, I speak chinese.


After I change LC_ALL and reboot, as well as change the charset in empty vimrc file, same problem persists. I do not have problem in file encoding, the vim in command line work fine without garble. However, once I try to start GUI version of vim(essentially, gvim), it breaks.

Thanks for yours help! Zesko & maycne.sonahoz.

For some reason that I don’t understand, this problem are fixed by installing vim-qt, from vim-qt.


Please do not post screenshots of text.
Copy + Paste and use appropriate formatting via </> button or adding three backticks ` above and below the text.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.