akermu / emacs-libvterm

Emacs libvterm integration
GNU General Public License v3.0
1.67k stars 131 forks source link

fzf display broken #605

Open finity84 opened 1 year ago

finity84 commented 1 year ago

fzf has been unusable for me under vterm, running it has its display trying to redraw constantly at the bottom of the screen. Using --reverse let's it somewhat display in the middle of the screen, but display is also garbled.

Using m1 mac latest versions of emacs/fzf from brew install, and vterm from Melpa. Tried on bash/zsh, and disabling configs seems to not help the issue. Works fine however on my remote linux machine using the same config.

I'm not sure but it might have used to work before, like a year ago or so.

finity84 commented 1 year ago

update I'm also getting this on a Debian 11 install, with apt's fzf, emacs master and latest emacs-libvterm

ackerleytng commented 1 year ago

I'm also having this issue but it only happens sometimes, so I guess that it might have something to do with vterm-timer-delay. I'll see how it goes if I set the delay to nil.

finity84 commented 1 year ago

Recently I found that it works fine after window resizing, somehow the vterm resize update doesn't trigger properly on startup and it assumes a different width. I don't know how to do that properly so instead I cobbled up snippets below to update on each new vterm process and seems to work well for me.

(defun vterm-new ()
  (interactive)
  (vterm t)
  (sleep-for 0.1)
  (fix-window-size))

(defun fix-window-size ()
  "Change process window size."
  (message "fixing window size")
  (when (derived-mode-p 'comint-mode)
    (let ((process (get-buffer-process (current-buffer))))
      (unless (eq nil process)
        (set-process-window-size process (window-height) (window-width))))))
zzantares commented 6 months ago

I'm also having this issue but it only happens sometimes, so I guess that it might have something to do with vterm-timer-delay. I'll see how it goes if I set the delay to nil.

@ackerleytng how did it go?

ackerleytng commented 6 months ago

Setting vterm-timer-delay to nil seems to have fixed it

tavisrudd commented 3 months ago

I found just adding this to my shell init works:

if [[ "$INSIDE_EMACS" = 'vterm' ]]; then
    resize &>/dev/null
fi