Hot answers tagged

15

When you are saying "I am using tramp via ssh" I suppose you open a file like /ssh:host:/path/to/file. This is supposed to use always the ssh method. If you want to use the scp method, you shall use /scp:host:/path/to/file. This uses automatically ssh for short files, and scp for large files. If you trust the default method set in tramp-default-method, you ...


13

Well this turned out to be more of a rabbit hole than I though... And for what I can gather there's not a better solution for this specific issue, with this combination of desktop, ssh-agent, emacs. Problem 1 XFCE was starting it's own ssh-agent with the session, without actually saying so anywhere, which caused the system to have 1 unused global ssh-agent, ...


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.


9

There are a few answers here. Quitting Emacs without C-x C-c First, you can quit emacs by running the command that C-x C-c is bound to: M-x save-buffers-kill-terminal. Alternatives to recursive Emacs Emacs is able to edit files on remote servers, so you don't even need to ssh into the remote server, and you won't need an Emacs inside a term inside your ...


8

Since TRAMP uses ssh by default, the real question you are asking is if you should use local or remote emacs to edit remote files. Right? Is it considered better to use ... There is no better, just that use cases differ for both local and remote editing. What are some of the considerations involved in making this decision? If you normally work with ...


7

You'll have to customize the tramp-password-prompt-regexp variable with the second prompt to finish the 2-factor authentication. The remote shell setup part of the manual has a simple example. This is not a new feature but an old feature that you adapt to the second prompt of the 2-factor authentication. This same facility was used in days of yore for ...


7

As pointed out by @Nsukami and briefly summarized in my comment he linked to, this is not supported out-of-the-box yet. But by following these suggestions you should be able to get it to work. What I don't understand is, if this doesn't work with when ssh'ing into a remote host, when would setting $EDITOR [to anything but emacsclient] by handy? Using ssh ...


7

I would do this outside of Emacs, with a wrapper script that pulls the updated config first. Something like this: #! /bin/sh cd ~/.emacs.d && git pull --rebase exec /usr/bin/emacs "$@" Then make this executable, name it emacs, and put it on your PATH before the real one. Another option would be to have init.el do pretty much the same thing: (call-...


7

Another solution for the lazy is to just use a package that handles exactly this case (setting Emacs' keychain-related environment variables): Install and add to your init.el package keychain-environment. Run M-x keychain-refresh-environment and now it should work. Place (keychain-refresh-environment) in your init.el, so the solution works after restarting ...


6

Magit's wiki now features a page about the various ways one can push from Magit when using MS Windows. Also checkout the new ssh-agency package. Both the wiki page and the package were written by @npostavs. Also note that it is virtually never Magit's fault if you cannot push. It's usually a configuration issue (even if you can push from the shell but not ...


6

Usually, the problem is that Emacs can't access the password prompt of git on Windows. Thus, it seems to "hang" on push, where it really is waiting for your password. You can circumvent this by using an ssh key instead of a username/password in your git repo, and doing the first push manually in the shell (git will remember your ssh password after the first ...


6

Similar to Emacs bug#20015, this can be avoided by setting tramp-ssh-controlmaster-options before loading tramp. (setq tramp-ssh-controlmaster-options "-o ControlMaster=auto -o ControlPath='tramp.%%C' -o ControlPersist=no") (require 'tramp) Or with use-package: (use-package tramp :init (setq tramp-ssh-controlmaster-options "-o ...


5

I agree with Emacs User: Neither approach is objectively "better". If you don't have any obvious compelling reason to go with one or the other, then it's really just a subjective balance between performance and convenience. If you need only occasional access to any given server, the ease of using TRAMP ought to trump a low-to-moderate performance hit. If ...


5

There is Tramp. You can edit a file on another machine using the syntax /ssh:user@machine:/path/to/file. If you take sudo instead of ssh, and empty user and machine, you can edit a local file as root. Like /sudo::/path/to/file.


5

I had a similar problem when trying to open/save plain ASCII files via tramp's sftp: the files were fine, I was able to edit them with, for example,nano, but trying to open them via tramp would get rejected with the rather cryptic message: invalid string format. This was probably related to inlining and compression, because changing those solved the issue ...


5

Using TRAMP multi-hops. For instance, if you want to edit the remote file /root/salary.txt /ssh:homer@powerplant|sudo:powerplant:/root/salary.txt The example is taken from the Mastering Emacs book.


4

This is common problem, seems to be a bug in Emacs. Potential solutions are; turn the number of CPUs down to 1 in virtual box. force display redraw in isearch (add-hook 'isearch-update-post-hook 'redraw-display) use this PPA (if you're on ubuntu) ppa:martin-trojer/emacs24-termfix Here's some references where this issue is also discussed; https://...


4

The pipe | is special to the shell, try quoting the whole filename.


4

Try this Open a remote directory in dired using tramp. C-x d /ssh:username@hostname:/path return Start a remote shell. M-x shell


4

Have you tried the multi-hop method as suggested in the TRAMP manual? C-x C-f /ssh:user@localhost|sudo:localhost:/path/to/file RET


4

That's not an issue, it's a statement of fact. M-x shell isn't a fully functional terminal - it simply can't do what you want it to do. If you want a full terminal emulator in emacs, you have to use M-x ansi-term instead.


4

Emacs 26 by default switches on double buffering for X servers when it finds the Xdbe header on the build machine. (See Emacs 26 release notes at the GitHub mirror.) Some X servers don’t support this. Therfore switching off double buffering by adding '(inhibit-double-buffering . t) to your frame parameters might fix this. Safest way is to add it to default-...


3

I know it's an old question and that you maybe don't care about the answer now but I do faced the same issue. I was pretty sure it was OS X related but in fact lags and timeouts were caused by my remote prompt! Tramp is limited in its remote prompt parsing and relies on it to know if a command has finished or not. I googled for days always including "os x"...


3

I have been struggling to do the same. I found a different route that allowed me to do basically the same thing. You can open a shell buffer by M-x shell and from there connect to the login node, and then connect to the interactive session by qsub -I. Once you're in the interactive session, start an R session by typing the command R. There, you can do M-x ...


3

It sounds like you should extend tramp-methods, adding a new method which is similar to the sudo method but uses qsub -I instead. You would then be able to use a multi-hop tramp path to first connect to the head node and then to connect to a compute node. Try this: (add-to-list 'tramp-methods '("qsub" (tramp-login-program "qsub") (tramp-...


3

If you haven't already done so, I would recommend using SSH instead of HTTP as many have recommended to me during my investigation of this. That said, I was able to resolve this issue using the below FAQ: https://github.com/magit/magit/wiki/FAQ#windows-cannot-push-with-ssh-passphrase The missing component (from Github's Git Bash .bashrc script) is that it ...


3

After suggestions... (defun add-ssh-agent-to-tramp () (cl-pushnew '("-A") (cadr (assoc 'tramp-login-args (assoc "ssh" tramp-methods))) :test #'equal)) (add-ssh-agent-to-tramp)


3

Starting with Tramp 2.2.13, you will be able to overwrite entries of tramp-methods. In your case, you would do something like (add-to-list 'tramp-connection-properties (list (regexp-quote "/ssh:user@randomhost.your.domain:") "login-args" '(("-A") ("-l" "%u") ("-p" "%p") ("%c") ("-e" "...


3

Tramp works on the basis of default-directory. If you run a shell in Emacs, and you perform ssh in that shell, the buffers's default-directory is still the local path the shell was started from. You have three options to adapt default-directory: Start the shell while you are visiting a remote file or directory. The shell doesn't run on your local host, but ...


3

The Edison didn't have some of the utilities tramp needs (base64, uuencode). Apparently tramp sends a perl script if it can't find them, but it did not work. It turns out that even when using methods like scp, tramp tries to do inline transfers when the file is below a size threshold, tramp-copy-size-limit. I can do (setq tramp-copy-size-limit nil) to ...


Only top voted, non community-wiki answers of a minimum length are eligible