0

I use tramp-shell for ssh to another machine. Setup as follows:

(defun spawn-shell (name)
  "Invoke shell test"
  (interactive "MName of shell buffer to create: ")
  (pop-to-buffer (get-buffer-create name))
  (shell (current-buffer))
  )

(defun ssh-shell-impl (host)
    (let ((host-name (ssh-username host)))
      (let ((ssh-home-path (concat (concat (concat "/ssh:" host) ":/home/") host-name)))
        (let ((default-directory ssh-home-path))
          (find-file ssh-home-path)
          (let ((shell-name (if (get-buffer "shell") (concat host-name "-shell") "shell")))
            (spawn-shell shell-name)
            )
          )
        )
      )
    )

(defun ssh-shell ()
  (interactive)
  (let ((host (read-string "Enter Host: ")))
    (ssh-shell-impl host)
    )
  )

This works perfectly for everything except commands where the output amount is suppose to be interactive (think man tail). Instead of outputting a portion and prompting to exit/more lines, the entire content is dumped.

Is there a way to get the interactive output on tramp-shell?

Emacs version info:

GNU Emacs 27.1
1
  • 1
    You don't have to include the text "Copyright (C) 2020 ..."; instead, you can point out what OS you're using.
    – shynur
    May 1 at 19:35

1 Answer 1

3

No, this isn't supported by Tramp. It suppresses all pagers when calling interactive commands like man. See "PAGER=cat" in tramp-remote-process-environment.

And even if you change this to "PAGER=less" or so it wouldn't help, because the page break wouldn't be handled in the shell command's output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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