emacs-neotree icon indicating copy to clipboard operation
emacs-neotree copied to clipboard

Feature: Add tramp support

Open watzon opened this issue 9 years ago • 13 comments

Currently when connecting to a remote server via ssh or ftp (using Tramp) it is impossible to use neotree. When I try to ssh in to a remote server and use neotree to pick a file to edit I get the following error Invalid base64 data and it completely clears the contents of the file I tried to edit. This ended up being really bad in one case where I was attempting to edit an index.php and it cleared the contents and saved it.

watzon avatar Dec 15 '15 17:12 watzon

Hi iDev0urer,

NeoTree supports tramp, and I am usually open a remote directory by using NeoTree.

I found a topic that is similar with it, https://lists.gnu.org/archive/html/emacs-devel/2004-05/msg00804.html

I am not sure whether or not there is a bug in NeoTree. If so, I need more informations to reproduce it.

Jay

jaypei avatar Jan 30 '16 15:01 jaypei

Hi. I have the same bug. If I open a remote file with C-x C-f and all work as expected but when I open the same file with neotree I get - Invalid base64 data. I use Emacs 25.1.1 on Mac OS X.

AlexeyBelezeko avatar Nov 01 '16 17:11 AlexeyBelezeko

I have the exact same problem described by @AlexeyBelezeko .

When I open a file that's large enough for gzip to be invoked using neotree, I get Invalid base64 data. From my message buffer:

Tramp: Inserting ‘/ssh:doe:vgg16.py’...
Tramp: Encoding remote file ‘/ssh:doe:vgg16.py’ with ‘(gzip <%s | base64)’...done
Tramp: Decoding local file ‘/tmp/tramp.6469P3F.py’ with ‘(lambda (beg end) (base64-decode-region beg end) (let ((coding-system-for-write (quote binary)) (coding-system-for-read (quote binary)) (default-directory (tramp-compat-temporary-file-directory))) (apply (quote tramp-call-process-region) [ssh nil doe vgg16.py nil] (point-min) (point-max) (car (split-string gzip -d)) t t nil (cdr (split-string gzip -d)))))’...failed
Tramp: Inserting ‘/ssh:doe:vgg16.py’...failed
tramp-file-name-handler: Invalid base64 data

I've inspected the transferred string (by setting tramp-verbose up) and I can decode it using gzip and base64, so the data itself is fine, but the decoding step fails.

I'm using emacs 25.1-4 and neotree 20170227.1731.

afoda avatar Apr 14 '17 08:04 afoda

I can confirm that I have the same problem with neotree and tramp.

reconmaster avatar Apr 21 '17 13:04 reconmaster

+1

thatnerdjosh avatar Aug 12 '17 15:08 thatnerdjosh

yep +1

RolandMacDoland avatar Oct 24 '17 08:10 RolandMacDoland

+1 for me too

ReedRichards avatar Feb 12 '18 21:02 ReedRichards

+1. The same bug.

vietanhdev avatar Mar 01 '18 09:03 vietanhdev

Me too

bolerap avatar May 09 '18 08:05 bolerap

It's working fine for me. However, I mistakenly opened a file in /bin that gave me this error.

hsg777 avatar May 13 '18 02:05 hsg777

Does anyone have any solutions? I found this seem similar but not sure https://github.com/gregsexton/ob-ipython/commit/d5b1385115544d4055d2bf9faf163cc1d40e6623

bolerap avatar May 14 '18 02:05 bolerap

still actual

KraevRoot avatar Jul 18 '18 06:07 KraevRoot

This has something to do with initializing a tramp connection from neotree. If I establish a tramp connection using C-c c in neotree that tramp connection won't work anywhere including dired or find file; However if I establish a tramp connection outside of neotree(i.e. with dired or find file), then it works fine in neotree.

Update 1:

From a new emacs window:

  • ~~Invalid base64 data: open neotree > C-c c > connect tramp > load file via tramp in any way~~
  • ~~Invalid base64 data: C-x d or C-x C-f > connect tramp without opening a file > open neotree > load file via tramp in any way~~
  • ~~no error: C-x d or C-x C-f > connect tramp > open file > open neotree(neotree will open in tramp path) > open file from neotree~~
  • ~~no error: open neotree > C-x d or C-x C-f > connect tramp > open file > C-c c in neotree specify tramp path that's been opened > open file from neotree~~

Update 2

After further tinkering I've found:

  1. Prior to using neotree on a tramp connection I can open any file.
  2. Once a tramp path has been used in neotree, all files larger than 4096 bytes give the "Invalid base64 data" error regardless of how they're opened
  3. This only affects opening files. If the file is already open, can be modified and saved without issues. but once closed it can't be reopened in the same session of emacs.

mvanorder avatar Oct 17 '18 18:10 mvanorder