Repository navigation
Show a file's permissions, and make one's own files executable or not - #103
JaxonWright wants to merge 4 commits into
Conversation
[Medium impact] The PR appears safe to merge with the stated tradeoff for slow drives. SummaryAdds a Permissions row and menu actions to make owned files executable or not.
No new actionable issues found. Earlier fixes remain in place. JaxonWright intentionally accepted possible window pauses during permission changes because existing file actions and menu checks also run on the UI thread. Reviews (7) · Last reviewed commit: "Change no file's mode while other work i..." · Reviewed by Greptile |
f901f19 to
99f4dd5
Compare
|
Thanks @JaxonWright! I rebased this onto main, where the details are now a column and every item is already read off the window's thread (for its created time), so the permissions read joins that. On top: Greptile's last point, a file gone since the menu opened now says why instead of being skipped silently. I also dropped the claude.ai session link from the commit messages. |
|
@dhh thank you! There's still conflicts preventing a merge, though |
677bfc9 to
1d5b824
Compare
1d5b824 to
0fd5d7a
Compare
The details pane gains a Permissions row, as ls writes them, read with the rest of the details off the UI thread; it keeps its place while they're read, and isn't shown in the trash. The menu on one's own files gains Make Executable, or Make Not Executable when they all run already: it lets whoever may read a file run it, so a private file stays private, and takes running away from everyone. Folders, whose x means something else, links, and other people's files don't get it. The pane reads the item again when its permissions change, since the folder looks the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…looked at Moving across folders on a mount that stopped answering left a stuck stat per folder in the shared pool, and once those filled it no folder could be listed: the readings now have four threads of their own. The permissions are changed through the handle they were checked on, so a link put anywhere in the path since can't send the change to another file. And the row is hidden by the folder being the trash, known at once, rather than by the note read later, which showed it for a moment and kept it for what's inside a trashed folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A selected file moved away, or whose folder went out of reach, after the menu opened was skipped without a word, while a failed chmod said why. Now both say why; a folder, link or someone else's file is still left alone quietly, as the menu never offered them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Make Executable ran while the pane was copying, so a file still being copied could have its execute bits taken off, and then the copy, once done, gave it its source's mode again without a word. It now waits for the work under way like every other change to files, and says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0fd5d7a to
20169c2
Compare

You can't tell from Files whether a script will run, or make it run. The usual case is a downloaded
install.sh, or one just written in a project. Today that needs a terminal andchmod +x. This adds a Permissions row to the details pane and a Make Executable entry to the menu.What you'd notice
ls -lwrites them:rw-r--r--,rwxr-xr-x. It's there for any file or folder on a local or mounted drive, but not in the Trash (nor inside a trashed folder), where nothing changes them. The row keeps its place while the permissions are read, so moving through files with the arrows doesn't shift the rows below it.Folders, links and other people's files don't get the entry. A folder's
xmeans something else, and only a file's owner may change its mode.A folder's menu has no entry, and its row shows the folder's own permissions:
How it decides
rw-r--r--becomesrwxr-xr-x, the same aschmod +x. A privaterw-------becomesrwx------, wherechmod +xwould let everyone run it (rwx--x--x).O_PATH | O_NOFOLLOW), checked through that handle, and changed through it (its/proc/self/fdlink, sincefchmod()won't take anO_PATHhandle). A link put anywhere in the path after the menu opened can't send the change to another file, and the new mode comes from the same file that's changed.What changed
Backend::describe()reads the item's mode in its background read and addspermissionsto the details. Until now it skipped the read for anything but pictures, text and trashed items. Now every local item gets onestat, off the UI thread, with the same skip for selections the cursor has already moved past.These reads now run on a pool of four threads of their own, not the shared pool that folders are listed on. Moving across folders on a mount that stopped answering leaves one stuck
statper folder. In the shared pool, those stuck reads eventually stopped any folder from listing, even a local one. Greptile caught this, and I confirmed it on a real window: with a FUSE mount frozen by SIGSTOP, I moved across 20 of its folders and then opened a local folder. (mainand both builds of this PR here also carry Tell the trash from the path, without asking every drive #93's fix, so leaving the dead mount doesn't stall first.)Selecting a file there is a different, older problem: the Opens with row asks for its type on the UI thread (
mimeFor()), so the window waits until the mount answers. That's worth its own PR.FileOpsgainscanSetExecutable,executableandsetExecutable, and amodesChanged(paths)signal. The change itself runs on the UI thread, like Rename and New Folder do; the menu stats the selection there as it opens, as it does for Burn and Extract. The details pane listens for that signal, because a mode change leaves the folder listing as it was, so the pane would otherwise keep showing the old permissions.en.json.The mode isn't added to the folder listing's entries. #26 and #92 are reworking the listing and its memory, and only the selected item needs it.
Not in this PR: undo. The undo log records moves and renames. Picking the entry again puts the file back as it was.
Verification
I drove a real Files window on Hyprland: selected a
rw-r--r--script, opened the menu from the keyboard (Alt+⏎) and picked Make Executable. The file wasrwxr-xr-xon disk, the row saidrwxr-xr-x, and the reopened menu offered Make Not Executable. Picking that put the file back torw-r--r--, and the row followed. A folder's menu has no entry, and its row shows the folder's own permissions. I only drove a single file in the window. The selection rules (one ineligible item hides the entry, mixed states offer Make Executable) are covered by the unit test.Tests (suite 194 → 196, all pass):
fileOpsMakesFilesExecutablecovers 644 to 755 and back, 600 to 700 and back, and a selection that also holds a folder (the folder is left alone, andmodesChangednames only the files). It also refuses a folder, a link, an empty selection and a file you don't own.backendShowsWhoMayReadWriteAndRunreadsrw-r-----for a file andrwxr-xr-tfor a sticky folder, for a PDF, which the old early return would have skipped.🤖 Generated with Claude Code
https://claude.ai/code/session_01UGcPV5q4WWVxgL57jZ2Vm7