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

drawing error with nvim #15

Closed
atondwal opened this issue Apr 17, 2021 · 6 comments
Closed

drawing error with nvim #15

atondwal opened this issue Apr 17, 2021 · 6 comments

Comments

@atondwal
Copy link

Last line seems to draw incorrectly and wrap when using nvim (this example has me repeatedly typing o<Esc> in an empty file). Doesn't seem to happen with any other terminal emulator. Happens with empty init.vim and .mlterm configurations.

nvim

mlterm version 3.9.1 post/2021-04-09
Features: otl ssh implugin imagelib(builtin) utmp
NVIM v0.4.4
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.4.4/src -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
Compiled by builduser

Features: +acl +iconv +tui
@atondwal
Copy link
Author

bisect implicates 34a54dae514f20ce2f1d7b847092fe0ffbdcfeee

@atondwal
Copy link
Author

Ah, this is a matter of control characters! Since xterm accepts any of the U+0000 block control characters 0x00-0x1F for escape sequences, when our TERM=xterm, nvim will use them. This can solved for me by either setting TERM=kterm (or urxvt, st, etc...) or by editing

if ((bel_terminate && **str == CTL_BEL) || (use_c1 && **str == 0x9c)) {

to include the additional condition **str < 0x20 ||. Setting TERM solves the problem for me, so feel free to close, but if you want to maintain compatibility with xterm's termcap/info, might be worth fixing this.

@arakiken
Copy link
Owner

Thanks very much.

I'd like to understand the cause of this problem, but I couldn't reproduce it in my environment
(nvim 0.4.4, mlterm-3.9.1 on arch linux).
I think that it doesn't fix incompatiblity with xterm completely to add '**str < 0x20' to get_pt_in_esc_seq(),
I'm wondering how to fix it with another approach.

Would you start mlterm with --logseq option and send me ~/.mlterm/*.log ?
It will help me reproduce the problem.
If possible, I'd like to see the result of 'infocmp xterm' command on your system.

Regards,

@atondwal
Copy link
Author

Thanks for the response! I'm also using nvim 0.4.4 on arch linux (seeing this with both mlterm-3.9.1 as well as master on a fresh arch install installed from the AUR
pts_11-20210420084942.log
)
xterm.infocmp.txt

@arakiken
Copy link
Owner

Thanks to your help, I found that mlterm-3.9.1 or before failed to parse OSC sequence which doesn't contain semicolon.
I fixed it, so I'd like you to test it.

48e7865#diff-c9af0817cb9fcedacbeb3ec34e3d026ce4da2ce96eda2bf96b76043ae8de0e6b

@atondwal
Copy link
Author

Works great now!

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jan 17, 2022
pkgsrc changes:
* switch MASTER_SITES to GitHub
* use GTK3 instead of GTK2
* remove local patches integreated into upstream (#5)

Upstream changes (noted in doc/en/ReleaseNote):

ver 3.9.2
* Support Fcitx5.
* Support GTK4 for mlconfig. (./configure --with-gtk=4.0)
* Support CSI > Ps q (XTVERSION). (Response: DCS>|mlterm(3.9.2)ST)
* Add "MOSH_UDP_PORT" environmental variable to specify UDP port or port-range
  to communicate with a mosh server.
* Add INSERT_CLIPBOARD shortcut key.
  (arakiken/mlterm#19)
* Add --fk / format_other_keys option (equivalent to "formatOtherKeys" of xterm), and
  change the default format of the escape sequence with modifyOtherKeys from
  CSI Ps; Ps u to CSI 27; Ps; Ps ~.
* Add --with-iconv, --disable-daemon, --disable-split and --disable-zmodem
  options to ./configure script.
* Add vte 0.66 API symbols to libvte compatible library.
* Show server list dialog at startup on Android.
* It is deprecated to use "mlterm" as the value of termtype / -y option.
* 'termcap' config file stops to accept multiple terminal types concated by '|'
  (e.g. xterm|xterm-256) as key.
* Arabic ligatures (U+644-U+622, U+644-U+622, U+644-U+625, U+644-U+627) occupy
  two logical columns instead of one even if --dyncomb option isn't specified.
* KBD_INPUT_NUM and MOUSE_INPUT_NUM environmental variables (for mlterm-fb)
  accept multiple device numbers by "<num>,<num>".
* Show "Config: key=value" only if shortcut keys whose format is
  "proto:(echo)key=value" is pressed.
* Merge patches:
  arakiken/mlterm#5.
  arakiken/mlterm#9.
  arakiken/mlterm#12.
  arakiken/mlterm#22.
* Bug fixes:
  Fix arakiken/mlterm#15.
  Fix arakiken/mlterm#18.
  Fix arakiken/mlterm#24.
  Fix arakiken/mlterm#28.
  Fix failure of restarting mlterm on Android. (Enbugged at 3.9.1)
  Fix segfault if mlterm screen with -t option goes outside of the display.
  Fix emoji glyphs becoming too large with cairo.
  Fix corrupt value of "word_separator" option which mlconfig outputs.
  Fix incompatibility with xterm in pressing Shift + a-z keys etc if modifyOtherKeys is 1.
  (arakiken/mlterm#21)
  Fix segfault in opening a new roxterm tab with libvte compatible library on wayland.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants