FedeDP / ncursesFM

Ncurses File Manager for linux
GNU General Public License v3.0
86 stars 2 forks source link

impossible to open a file in a ssh session #22

Open JujuLand opened 7 years ago

JujuLand commented 7 years ago

Hi, I frequently use ssh -X sessions to work on distant computers (on LAN or WAN).

For example, I can open a pdf file with xdg-open. With ncursesFM, no error, but it doesn't open.

As I hoped to use ncursesFM as a file browser which uses smaller resources than a graphic file browser, I'm a little desappointed ... Too bad

A+

FedeDP commented 7 years ago

Mmh ncursesFM checks for "getenv("XDG_SESSION_TYPE")". Can you paste me the output of "echo $XDG_SESSION_TYPE" in your ssh -X session?

JujuLand commented 7 years ago

alain@aupeix-GX723:~$ echo $XDG_SESSION_TYPE ` alain@aupeix-GX723:~$ `

annie@xubuntu-IMEDIA:~$ echo $XDG_SESSION_TYPE ` annie@xubuntu-IMEDIA:~$ `

Here are the ssh versions:

annie@xubuntu-IMEDIA:/opt/TuxPrograms/trunks/ncurseFM$ paquet ssh ii libssh-gcrypt-4:amd64 0.6.3-4.3 amd64 tiny C SSH library (gcrypt flavor) ii libssh2-1:amd64 1.5.0-2ubuntu0.1 amd64 SSH2 client-side library ii openssh-client 1:7.2p2-4ubuntu2.2 amd64 secure shell (SSH) client, for secure access to remote machines ii openssh-server 1:7.2p2-4ubuntu2.2 amd64 secure shell (SSH) server, for secure access from remote machines ii openssh-sftp-server 1:7.2p2-4ubuntu2.2 amd64 secure shell (SSH) sftp server module, for SFTP access from remote machines ii ssh 1:7.2p2-4ubuntu2.2 all secure shell client and server (metapackage) ii ssh-import-id 5.5-0ubuntu1 all securely retrieve an SSH public key and install it locally ii sshfs 2.5-1ubuntu1 amd64 filesystem client based on SSH File Transfer Protocol

alain@aupeix-GX723:/opt/TuxPrograms/trunks/ncurseFM$ paquet ssh ii libssh-4:amd64 0.6.3-4.3 amd64 tiny C SSH library (OpenSSL flavor) ii libssh-dev 0.6.3-4.3 amd64 tiny C SSH library. Development files (OpenSSL flavor) ii libssh-gcrypt-4:amd64 0.6.3-4.3 amd64 tiny C SSH library (gcrypt flavor) rc libssh2-1:amd64 1.4.3-2 amd64 SSH2 client-side library ii openssh-client 1:7.2p2-4ubuntu2.2 amd64 secure shell (SSH) client, for secure access to remote machines ii openssh-server 1:7.2p2-4ubuntu2.2 amd64 secure shell (SSH) server, for secure access from remote machines ii openssh-sftp-server 1:7.2p2-4ubuntu2.2 amd64 secure shell (SSH) sftp server module, for SFTP access from remote machines ii ssh 1:7.2p2-4ubuntu2.2 all secure shell client and server (metapackage) ii ssh-import-id 5.5-0ubuntu1 all securely retrieve an SSH public key and install it locally ii sshfs 2.5-1ubuntu1 amd64 filesystem client based on SSH File Transfer Protocol

Thanks A+

JujuLand commented 7 years ago

I have these variables when connected: SSH_CLIENT=192.168.1.15 42052 22462 SSH_TTY=/dev/pts/7 SSH_CONNECTION=192.168.1.15 42052 192.168.1.14 22462

If it can help ...

FedeDP commented 7 years ago

Can you please try to export XDG_SESSION_TYPE=x11 in you ssh -X session and retry? The logic behind is that if no XDG_SESSION_TYPE is found in environment, it means we're running on a tty, thus ncursesFM tries to use "nano" or whatever editor is setted. I will try to fix this logic though.

JujuLand commented 7 years ago

I add this variable in .profile, and it works.

Which thing, usually set this variable ?

A+

FedeDP commented 7 years ago

Nice! i think desktop manager or desktop environment usually set this variable. For now you can use a script that export the variable before starting ncursesfm. I'll try to solve the issue though.

JujuLand commented 7 years ago

Adding it in profile is enough and doesn't make problem using directly xdg-open.

So do what you can.

Thanks A+