NvChad / ui

Lightweight & high performance UI plugin for nvchad
GNU General Public License v3.0
304 stars 137 forks source link

Terminal output flows outside of Term window #332

Closed fishBone000 closed 2 months ago

fishBone000 commented 2 months ago

NvChad: v2.5 zsh: 5.9 alacritty: 0.13.2 Using default Term config

Try hold down any key inside Term, for example "j", then notice the "jjjjjj" will gradually grow to the right side of Term, then overflows. Screenshot_20240904_072817 Screenshot_20240904_072831 Screenshot_20240904_072849 The "62m" is actually "62ms", which indicates how long did last command cost. It's affected by the overflow issue, so the "s" is missing.

siduck commented 2 months ago

increase the floating window size?

fishBone000 commented 2 months ago

I don't think it's working? I tried to increase the width to 0.6, the width increases but overflow still happens.
If I'm right it's a regression, I remember on last version the term works just fine.

siduck commented 2 months ago

does it happen on non float terms?

fishBone000 commented 2 months ago

Yes, floating, horizontal and vertical.
All of them overflows 2 characters.
This doesn't happen to you?

siduck commented 2 months ago

i dont type such long commands, and my shell will just keep it in 1 line

image

fishBone000 commented 2 months ago

In one line? Even if you hold "f" long enough?
I don't type such long command neither, actually I found it out by the "62m", it should be "62ms" so I know it overflowed.

siduck commented 2 months ago

In one line? Even if you hold "f" long enough?

yes

i think its your shell prompt issue

fishBone000 commented 2 months ago

Hmm wait.

By my understandings, in regular terminals (alacritty, Konsole e.t.c., not Term), those "fffffff" will get truncated and appears as multiple lines if it gets too long. I think it happens to you right?

And in Term, "ffffff" gets truncated to new lines too, it's just that on my end it overflows 2 character.

and my shell will just keep it in 1 line

Does it happen to Term only or regular terminals too?

I think I will do more research.

siduck commented 2 months ago

yes mine gets trunacated too!

try in :term , if issue happens there too then i cant do nothing about it

fishBone000 commented 2 months ago

No it doesn't happen in :term.

Plus I found that it gets itself fixed if I unmaximize and maximize my alacritty. I can guess there might be a resize event that somehow gets the Term size parameters or whatever right?

siduck commented 2 months ago

use :term and resize your terminal window to small

Also you can message in our discord/matrix server, i'm more active there than here

fishBone000 commented 2 months ago

Sure, will join discord after I have some food

siduck commented 2 months ago

Sure, will join discord after I have some food

you can join the matrix server if you care about FOSS and all :grin: . or telegram, all 3 are bridged! :rocket:

fishBone000 commented 2 months ago

Sure, will try Matrix

drcrees commented 2 months ago

I'm facing this exact issue, was there a fix?

fishBone000 commented 2 months ago

I'm facing this exact issue, was there a fix?

There's not for now... Me and @siduck discussed about it on Matrix, but didn't come to a conclusion. I tried to research a bit more on my own, but I have no clue...

drcrees commented 2 months ago

I was able to work around the issue by setting opts.style="minimal" when opening the floating window.

Update: More specifically, this is resolvable by setting signcolumn = "auto" in winopts. This will fix both float and split terminals.

winopts = {  signcolumn = "auto" }
fishBone000 commented 2 months ago

@drcrees how did you find this solution? It's working!

drcrees commented 2 months ago

@fishBone000 I just got lucky messing around with the nvchad.term Lua and reading Neovim API docs.

https://neovim.io/doc/user/api.html#_floating-windows

^ that bit of documentation led me to try opts.style="minimal" which worked for floating terminals, but not split.

So I looked further into what style did and I was able to narrow it down to the specific option.

style: (optional) Configure the appearance of the window. Currently only supports one value: "minimal" Nvim will display the window with many UI options disabled. This is useful when displaying a temporary float where the text should not be edited. Disables 'number', 'relativenumber', 'cursorline', 'cursorcolumn', 'foldcolumn', 'spell' and 'list' options. 'signcolumn' is changed to auto and 'colorcolumn' is cleared. 'statuscolumn' is changed to empty. The end-of-buffer region is hidden by setting eob flag of 'fillchars' to a space char, and clearing the hl-EndOfBuffer region in 'winhighlight'.

fishBone000 commented 2 months ago

@fishBone000 I just got lucky messing around with the nvchad.term Lua and reading Neovim API docs.

https://neovim.io/doc/user/api.html#_floating-windows

^ that bit of documentation led me to try opts.style="minimal" which worked for floating terminals, but not split.

So I looked further into what style did and I was able to narrow it down to the specific option.

style: (optional) Configure the appearance of the window. Currently only supports one value: "minimal" Nvim will display the window with many UI options disabled. This is useful when displaying a temporary float where the text should not be edited. Disables 'number', 'relativenumber', 'cursorline', 'cursorcolumn', 'foldcolumn', 'spell' and 'list' options. 'signcolumn' is changed to auto and 'colorcolumn' is cleared. 'statuscolumn' is changed to empty. The end-of-buffer region is hidden by setting eob flag of 'fillchars' to a space char, and clearing the hl-EndOfBuffer region in 'winhighlight'.

Coool, i thought nvim calculated the terminal dimension incorrectly

You did well!