Context
The pane free-space indicator (added for the local backend) inherits Vfs::space → Ok(None) for
SSH/SFTP, so remote panes show no free-space figure. russh-sftp does implement the
statvfs@openssh.com extension, but only on its raw session (RawSftpSession::statvfs); the
high-level SftpSession Cairn uses (SftpVfs/RealSftp) doesn't re-expose it, and there's no
documented way to reach the inner raw session.
Proposal
- Get access to the raw session's
statvfs (either hold a RawSftpSession alongside/instead of the
high-level SftpSession in the connect path, or upstream a SftpSession::statvfs passthrough).
- Add
SftpOps::statvfs + RealSftp impl mapping Statvfs { blocks, blocks_avail, fragment_size }
→ SpaceInfo { total: blocks*frsize, available: blocks_avail*frsize } (fragment_size, not
block_size). Map "extension unsupported"/transport failure → Ok(None) (decorative, never a gate).
- Advertise
Caps::SPACE for SftpVfs; add a short per-connection TTL cache (5–10s) to avoid a
round-trip on every navigate.
- MockSftp support + a unit test (incl. fragment_size != block_size).
Context
The pane free-space indicator (added for the local backend) inherits
Vfs::space→Ok(None)forSSH/SFTP, so remote panes show no free-space figure. russh-sftp does implement the
statvfs@openssh.comextension, but only on its raw session (RawSftpSession::statvfs); thehigh-level
SftpSessionCairn uses (SftpVfs/RealSftp) doesn't re-expose it, and there's nodocumented way to reach the inner raw session.
Proposal
statvfs(either hold aRawSftpSessionalongside/instead of thehigh-level
SftpSessionin the connect path, or upstream aSftpSession::statvfspassthrough).SftpOps::statvfs+RealSftpimpl mappingStatvfs { blocks, blocks_avail, fragment_size }→
SpaceInfo { total: blocks*frsize, available: blocks_avail*frsize }(fragment_size, notblock_size). Map "extension unsupported"/transport failure →
Ok(None)(decorative, never a gate).Caps::SPACEforSftpVfs; add a short per-connection TTL cache (5–10s) to avoid around-trip on every navigate.