Bug 2760 - cd Command With No Arguments
Summary: cd Command With No Arguments
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sftp (show other bugs)
Version: 7.5p1
Hardware: All All
: P5 enhancement
Assignee: Damien Miller
URL:
Keywords:
Depends on:
Blocks: V_7_7
  Show dependency treegraph
 
Reported: 2017-08-16 04:19 AEST by skerbsf
Modified: 2021-04-23 15:10 AEST (History)
2 users (show)

See Also:


Attachments
support ch/lcd with no arguments (4.42 KB, patch)
2017-11-03 14:07 AEDT, Damien Miller
dtucker: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description skerbsf 2017-08-16 04:19:52 AEST
This is a usability issue that is debatable.  The sftp client currently returns an error when no arguments are given.  It appears that the server does not even get involved.

> sftp kona3
Connecting to kona3...
Password: 
sftp> cd
You must specify a path after a cd command.

Personally, I believe that the client should change into the remote home directory when cd with zero arguments is typed.  This would mimic the behavior users expect/are used to on UNIX filesystems/utilities.  Of course, I am new here and have different expectations, but this does seem like a usability issue IMO.  Thanks.
Comment 1 Damien Miller 2017-11-03 14:07:26 AEDT
Created attachment 3083 [details]
support ch/lcd with no arguments

This implements most of your request. The problem is that sftp can't determine the actual user home directory on the remote side, so this saves the directory that the session starts in and uses that.
Comment 2 Damien Miller 2017-11-03 16:14:05 AEDT
This is committed and will be in OpenSSH 7.7
Comment 3 Damien Miller 2021-04-23 15:10:02 AEST
closing resolved bugs as of 8.6p1 release