[GH-ISSUE #178] SFTP can't handle if remotepath is not /home/username #113

Closed
opened 2026-02-26 23:58:31 +03:00 by kerem · 3 comments
Owner

Originally created by @renpj on GitHub (Jan 3, 2018).
Original GitHub issue: https://github.com/electerm/electerm/issues/178

In src/client/components/sftp/index.jsx line 313, it set:

 let remotePath = username === 'root'
      ? '/root'
      : `/home/${tab.username}`

Maybe we can modify to:

  let remotePath = username === 'root'
       ? '/root'
       : `~`

Can we just use '~/' as default remote path, not the absolute path? I'm newbie of electron, so it is kind of stupid.

Originally created by @renpj on GitHub (Jan 3, 2018). Original GitHub issue: https://github.com/electerm/electerm/issues/178 In src/client/components/sftp/index.jsx line 313, it set: ``` let remotePath = username === 'root' ? '/root' : `/home/${tab.username}` ``` Maybe we can modify to: ``` let remotePath = username === 'root' ? '/root' : `~` ``` Can we just use '~/' as default remote path, not the absolute path? I'm newbie of electron, so it is kind of stupid.
kerem 2026-02-26 23:58:31 +03:00
Author
Owner

@zxdong262 commented on GitHub (Jan 4, 2018):

thanks, sure it is a problem, will be fixed. but I do not know a better way to handle it for now. I tried '~', it do not work.do a try catch seems not elegant enough.I wonder if ssh server give the home folder info.

<!-- gh-comment-id:355181642 --> @zxdong262 commented on GitHub (Jan 4, 2018): thanks, sure it is a problem, will be fixed. but I do not know a better way to handle it for now. I tried '~', it do not work.do a `try catch` seems not elegant enough.I wonder if ssh server give the home folder info.
Author
Owner

@renpj commented on GitHub (Jan 5, 2018):

Can we just execute a command to obtain the home path?

<!-- gh-comment-id:355528305 --> @renpj commented on GitHub (Jan 5, 2018): Can we just execute a command to obtain the home path?
Author
Owner

@zxdong262 commented on GitHub (Jan 6, 2018):

not sure if there is a command like that, I will search it.

<!-- gh-comment-id:355731604 --> @zxdong262 commented on GitHub (Jan 6, 2018): not sure if there is a command like that, I will search it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/electerm#113
No description provided.