waveterm icon indicating copy to clipboard operation
waveterm copied to clipboard

[Bug]: screen flashes when using neovim

Open bedge opened this issue 1 year ago • 2 comments

Current Behavior

When editing in neovim from a terminal I'm getting momentary screen flashes of error messages. I had to do a screen recording then frame by frame playback to capture it as it's very short duration, but noticeable when it happens on every keystroke. Note this is not consistent. Not on all files. For whatever reason it happens when I edit ~/.config/waveterm/widgets.json image

It appears to be something interfering with vim operation as the top half of the screenshot shows some vim menus. mini.as is a vim plugin: https://github.com/echasnovski/mini.ai

This may be a vim issue, however I don't see this with any other terminal app while editing the same file.

Here's a link to the mini.ai key mappings as it appears like one of these menus is being invoked, then cancelled. To say that another way - it's like there's some extra key strokes being injected into the key input buffer than are bein=g interpreted as vim commands. Yeah, I know, this is bizarre, but I don't know how else to explain it.

Here's a video of this too, I'm just inserting and deleting characters.

https://github.com/user-attachments/assets/f3239f1d-49ca-4f9d-bf3b-d2472c8aece1

Expected Behavior

Smooth editing, not a flicker of error messages after typing text into the editor.

Steps To Reproduce

  1. Install lazyman neovin
  2. Install wateterm
  3. open a terminal in waveterm and edit ~/.config/waveterm/widgets.json
  4. Type text in insert mode
  5. Observe flickring.

Wave Version

Client Version 0.10.4 (202412210247) Update Channel: latest

Platform

Windows

OS Version/Distribution

windows 11

Architecture

arm64

Anything else?

No response

Questionnaire

  • [ ] I'm interested in fixing this myself but don't know where to start
  • [ ] I would like to fix and I have a solution
  • [ ] I don't have time to fix this right now, but maybe later

bedge avatar Dec 23 '24 00:12 bedge

Additional.

I neglected to say that I had added this to my config:

    "term:localshellpath": "C:\\Program Files\\Git\\bin\\bash.exe"

I removed that and repeated the test. The data seen in the flash is a bit different, but the basic behavior persists.

Uploading 2024-12-22_16-40-24.mp4…

bedge avatar Dec 23 '24 00:12 bedge

It appears to happen only when editing waveterm's config files, settings.json and widgets.json.

bedge avatar Dec 23 '24 00:12 bedge

could you try reuploading the second screen recording? It looks like it didn't finish

esimkowitz avatar Dec 23 '24 17:12 esimkowitz

Do you have auto-save enabled for your neovim config? Saving the waveterm config files triggers a frontend refresh, which could explain this

esimkowitz avatar Dec 23 '24 17:12 esimkowitz

2nd attempt for 2nd video upload. Will check on the autosave, that would explain it...

https://github.com/user-attachments/assets/3a9e0e2e-11bf-411d-9fcb-e12275db1a11

bedge avatar Dec 23 '24 19:12 bedge

Autosave is disabled.

bedge avatar Dec 23 '24 19:12 bedge

OK, I guess that needs clarification. The Autosave status command returns "Autosave is disabled`, but as you raised the question, I checked the timestamp on the file and it is indeed changing without my explicitly saving it. Apparently there's some other plugin that's doing this.

I suppose that's it then, mystery solved. I'll report back when/if I figure out what's triggering the autosave.

Thanks for the hints.

bedge avatar Dec 23 '24 19:12 bedge

Confirmed. This plugin https://github.com/brianhuster/autosave.nvim enables autosave but leaves the vim "Autosave" global "off". Thanks again.

bedge avatar Dec 23 '24 19:12 bedge

So weird, glad it got worked out!

esimkowitz avatar Dec 23 '24 20:12 esimkowitz