[Feature Request] umask functionality
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 40.5k
- Forks
- 2.3k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 85
Description
Related problem
Many Unix programs use the default permissions when creating files. The problem comes when mixing Nu with other shells. Directories and files created do not have the same permission. I ran across this recently for chezmoi, a dotfile manager. Running chezmoi status in bash (over SSH for example) states all files are out of date and need to be updated. This is because the umask/default permissions are different between bash and nu.
Describe the solution you'd like
Ideally, this would be implemented in core. Barring that, it would be nice if there was some way to set the permissions when creating files and directories.
Describe alternatives you've considered
I changed the global umask in /etc/login.def for openSUSE Leap.
Additional context and details
Issue #11731 was opened two weeks ago.
I asked about this on Discord first.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the save, touch, mkdir, and umkdir command entry points and review issue #11731 for overlap. Establish whether the accepted scope is core umask support or per-command mode flags, then verify that file and directory creation follows the documented permission behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100