akinsho / akinsho/toggleterm.nvim

Buffer of TUI apps are scrolled when hiding terminal or entering normal mode

Abierto
#391 3 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Lua
Estrellas
5.6k
Forks
206
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hi,

first of all Thank You for this plugin!

I encountered some strange behavior with "fullscreen" / TUI terminal apps like `lazy-git`, `bacon` (Rust test runner) or `ranger`:

I'll split this into two parts but I guess they are linked somehow.

### Scrolling sideways in normal mode

Whenever I toggle the terminal to be hidden or when a terminal loses focus, the apps mentioned above are scrolled to the left by the amount of characters set in `sidescrolloff`.

This also happens (though not always) when I just enter normal mode in a terminal with a TUI app running.

I think the issue is as follows:

`sidescrolloff` scrolls the buffer before the cursor reaches the edge of the buffer. When a TUI app is drawn, the cursor is at the bottom right of the buffer. When the terminal loses focus, the terminal enters normal mode. Since the cursor is at the right side of the screen, the buffer is scrolled left to fulfill the `sidescrolloff`.

When I set `sidescrolloff` to `0`, this does not happen.

Is it possible (either for the plugin or by using some sort of `on_focus` / `on_blur` hook to disable and restore the `sidescrolloff`?

### Scrolling down when hiding terminal

Even with `sidescrolloff` and `scrolloff` set to `0`, when I hide a terminal that has a "fullscreen" / TUI app running, the buffer is scrolled down by one line when I bring the terminal back up. Even stranger: when parts of the TUI get redrawn, they are now drawn one line below where they seem to belong (in fact they are drawn exactly where they should be but since everything is scrolled up by one line, it looks like they are drawn one line off)

When I enter normal mode after hiding and showing the terminal, the cursor is in the bottom left corner. I assume that for some reason the cursor moves down one line when the terminal is hidden and that this causes the buffer to be scrolled up.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.