ssh through emacs shell?

前端 未结 6 1632
闹比i
闹比i 2021-01-30 10:32

I wonder if anyone out there uses ssh through the emacs shell. I am able to connect with the remote machine but I cannot open files to view/edit with emacs using \'emacs filenam

相关标签:
6条回答
  • 2021-01-30 11:08

    You could use ssh x forwarding to run a remote emacs and display it on the local computer.
    I use Xming X Server when I'm on Windows

    You could mount the remote filesystem with ssh and open the locally as normally.
    For this I use ExpanDrive (commercial app) when on Windows

    You could use emacs Ange ftp over ssh it can open remote files over ftp and ssh.
    I use this with cygwin when on Windows

    0 讨论(0)
  • 2021-01-30 11:08

    Emacs option for ssh : c-x c-f /ssh:user@host:/home/path/

    For Reference: Open file via SSH and Sudo with Emacs

    0 讨论(0)
  • 2021-01-30 11:11

    A couple of ideas

    • Source the .bashrc explicitly via . ~/.bashrc and/or rearrange your bash init files and ~/.profile so that this gets loaded inside the emacs shell; then running ssh inside the Emacs shell works just fine
    • Use the emacs-specific Tramp mode to access remote files via ssh inside your local Emacs -- this is useful if you just need to update/touch/edit a remote file so you would not need to open a remote emacs inside the ssh session started from inside your local emacs.
    0 讨论(0)
  • 2021-01-30 11:11

    I have been struggling with Xming, which works, but as my internet connection is not the fastest I have to wait more 30 seconds before emacs or any X app even shows up. Also scrolling through a buffer after it has been opened will freeze from time to time => Very annoying

    Try No machine (nxserver-freenx server/client). There are free edition servers, absolute the best and fastest solution when you want to connect to a Linux box and use xterm and emacs over X. It shows up immediately and responds so fast. Even over a really slow connection :-) Clients are available for Windows, Mac OS, Linux

    0 讨论(0)
  • 2021-01-30 11:26

    Emacs has term-mode which is full blown terminal emulator you can run emacs in emacs. Anything you run on terminal will run in term-mode

    Also emacs has tramp mode which can open files through ssh.

    
    /scp:user@ipOrHost#port:/
    

    it will transfer files back and forth. you just edit them as you would edit local files.

    No need for x11 forwarding or other shenanigans.

    0 讨论(0)
  • 2021-01-30 11:27

    It may not be obvious on first sight, but eshell, the shell that is implemented in Emacs Lisp works fine with tramp:

    Welcome to the Emacs shell
    
    ~ $ uname -a
    Linux local-machine 2.6.30-1-686 #1 SMP Thu Jul 30 14:45:30 UTC 2009 i686 GNU/Linux
    ~ $ cd /ssh:user@remote-machine:~
    /ssh:user@remote-machine:/home/user $ uname -a
    Linux remote-machine 2.6.18-6-686 #1 SMP Thu Aug 20 21:56:59 UTC 2009 i686 GNU/Linux
    /ssh:user@remote-machine:/home/user $ 
    
    0 讨论(0)
提交回复
热议问题