8

I am trying to use Tramp with auto-revert-tail-mode to perform a tail of a remote log. Every time the log updates (which is often), the screen briefly jumps to the bottom of the file and then back to my current location in the file. Is there a way to prevent these frequent jumps? I simply want to be able to browse and search the most updated version of the file, but without being sent to the bottom of the file during every update.

Also, is there any way to quiet/silence the frequent updates in the status bar? "Tramp inserting:..." "Tramp encoding:...."

11

auto-revert-tail-mode is great, but it has its limits. Therefore I prefer to use an asynchronous shell command. Open the remote directory in dired, position the cursor to the file you want to watch, and apply ! tail -f * &.

If you want to suppress Tramp messages, decrease the verbosity. (setq tramp-verbose 1) shall be sufficient.

  • This is a great solution. If I try then to tail an additional file in a different buffer Emacs responds, "A command is running. Kill it?" . Is there any way to run multiple buffers with such an Async Shell Command? – ChaimKut Sep 1 '15 at 11:05
  • 1
    You must rename the *Async Shell Command* buffer. Move the cursor somewhere in the buffer, and apply M-x rename-buffer. – Michael Albinus Sep 1 '15 at 15:17
  • How can I do that sequence (! tail -f * &) in a lisp function in which I provide the name of the remote file? – Diogo Sep 19 '17 at 18:49
  • My temporary hack: (start-process-shell-command <process-name> <buufer-name> "ssh <use>r@<host> 'cd /path/to/folder && tail -f <filename>") – Diogo Sep 19 '17 at 19:12
  • Try adding (setf async-shell-command-buffer 'rename-buffer) to your .emacs file. It should then rename the existing async command buffer and then make the new one – Baggers Jun 29 '18 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.