mapsize 1.2.0: permanent delete and in-map reveal when headless
On a headless Linux or BSD system (no DISPLAY or WAYLAND_DISPLAY) nothing empties the freedesktop trash, so trashing never freed space. There, d now deletes permanently after an explicit confirmation, checking owner and type against the scan and removing through an os.Root on the parent so a swapped symlink cannot redirect it. o shows the folder in the map instead of launching a file manager. Desktop sessions, macOS and Windows are unchanged.
This commit is contained in:
@@ -70,3 +70,9 @@ func Trash(path string, _ Expect) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Headless is always false: Windows always has Explorer and the Recycle Bin.
|
||||
func Headless() bool { return false }
|
||||
|
||||
// Delete is not offered on Windows; items go to the Recycle Bin.
|
||||
func Delete(string, Expect) error { return errors.New("permanent delete not supported on Windows") }
|
||||
|
||||
Reference in New Issue
Block a user