Skip to content

hterm: titlebar character appearing over current line when typing if TERM=xterm-256color, scolling pane not working if TERM=hterm #19040

@aktau

Description

@aktau

Neovim version (nvim -v)

v0.8.0-dev gf479dd0bb

Vim (not Nvim) behaves the same?

no, but neither does nvim defaults (though please read along)

Operating system/version

Debian testing

Terminal name/version

hterm 1.92.1 (as used by the chrome Secure Shell extension), it is meant to be compatible with xterm

$TERM environment variable

xterm-256color

Installation

git clone && ...

How to reproduce the issue

Warning: It does not occur on base nvim --clean. I'm in the process of creating a minimal .vimrc that reproduces this (see the end of the issue). But I thought I'd file this in case anyone looks at the asciicast and has an insight. If that doesn't qualify for having an open issue, feel free to close this and sorry for the ruckus, I'll get back if I ever get more to the bottom of it.

It does not occur when using nvim in the native ChromeOS terminal instead of hterm ($TERM is also xterm-256color there).

The issue is reminiscent of #14650, with the difference that:

  1. My issue is triggering by typing, not scrolling.
  2. The characters that appear are not random. Instead they appear to be the terminal's titlebar.

This issue started occurring somewhen in the last two months AFAIK. I can partially fix it by setting (e.g.) TERM=hterm, despite that not being recommended by :help $TERM. However, that breaks pane scrolling (this can also be seen in the asciinema cast):

asciicast

Terminal issues confound me, so any hints for debugging this would be welcome.

NOTE: hterm terminal encoding is UTF-8

Expected behavior

I expect to see no stray characters that overlap my typing.

Actual behavior

When I type, lots of characters start appearing over the line I'm writing.

Minimal .vimrc

I'm trying to minimize this more. But it looks like both set hidden and set title are important to reproduce this. I've not been able to reproduce this without the nvim-cmp plugin. I'll have to dig in to see what it actually does.

" Install vim-plug if it's missing. Need curl(1) though.
if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall | source $MYVIMRC
endif

call plug#begin('~/.vim/bundle')

Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/nvim-cmp'

call plug#end()

set hidden                        " Handle multiple buffers better.
set title                         " Set the terminal's title

lua <<EOF
  local cmp = require('cmp')
  cmp.setup({
    snippet = { },
    mapping = cmp.mapping.preset.insert({ }),
    sources = cmp.config.sources({
      { name = 'buffer' },
    })
  })
EOF

Metadata

Metadata

Assignees

No one assigned

    Labels

    tuitermcodes, terminfo, termcap

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions