nushell / nushell/nushell

[Feature Request] umask functionality

Open
#11,884 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A:file-system category:enhancement POSIX-expectations status:needs-triage
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.

  • save
  • touch
  • mkdir
  • umkdir does not accept the --mode/-m flag unlike uutils/coreutils' mkdir.
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.