fix: remote directory size calculation via SFTP Walk on Space key
This commit is contained in:
parent
f3b2fe59c4
commit
cb40a1d008
2 changed files with 28 additions and 0 deletions
|
|
@ -2325,6 +2325,9 @@ func (m *Model) handleDirSize() (tea.Model, tea.Cmd) {
|
|||
log.Printf("[ACTION] DirSize: path=%s pane=%s", selected.Path, m.active)
|
||||
m.busy = true
|
||||
m.status = fmt.Sprintf("Calculating directory size for %s", selected.DisplayName())
|
||||
if mount, ok := m.activePane().CurrentRemote(); ok {
|
||||
return m, remoteDirSizeCmd(mount.Client, selected.Path)
|
||||
}
|
||||
return m, dirSizeCmd(selected.Path)
|
||||
}
|
||||
|
||||
|
|
@ -4692,6 +4695,13 @@ func dirSizeCmd(path string) tea.Cmd {
|
|||
}
|
||||
}
|
||||
|
||||
func remoteDirSizeCmd(client *remote.SSHClient, path string) tea.Cmd {
|
||||
return func() tea.Msg {
|
||||
size, err := client.DirectorySize(path)
|
||||
return dirSizeMsg{path: path, size: size, err: err}
|
||||
}
|
||||
}
|
||||
|
||||
func copyPlanCmd(kind fileOpKind, sourcePaths []string, targetDir string, overwrite bool, existingTargets int) tea.Cmd {
|
||||
return func() tea.Msg {
|
||||
stats := vfs.TransferStats{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue