Htop in emacs' ansi-term won't resize

1.1k views Asked by At

I am trying to run htop in ansi-term in a graphical (X session) emacs, and htop won't resize. Whatever size the window/frame is when I start htop is the size it continues to try rendering at forever.

Things I've tried:

  1. Running ansi-term on htop directly and inside an ansi-term running zsh.
  2. Manually sending a SIGWINCH w/ kill -28 $pid to the htop process. Also to the parent zsh process when there was one.
  3. Telling emacs to send the signal with emacsclient eval'ing (signal-process nil 28) and with (signal-process (get-buffer-process (get-buffer "mybuffername")) 28). I know the signal gets through because sending signal 29 kills the process.

Interestingly plain ol' top does resize, but only when the frame containing its buffer has X input focus. Htop still doesn't resize regardless of focus though. Also interestingly emacs itself running in console mode in ansi-term does resize, but only when given input. So you have to press up or down or write a character first or something.

Ideally all 3 would always resize immediately when the window does. Emacs has a hook for detecting this, I just need to know what to tell the hook to do.

Any ideas?

0

There are 0 answers