Skip to content

Commit

Permalink
ulimit: Change default to access soft limits (xonsh#3990)
Browse files Browse the repository at this point in the history
* ulimit: Change default to access soft limits

It makes more sense to manipulate "soft" limits by default, because
those are the limits intended to be user-adjustable. This is also
what bash does. Originally, I made ulimit to default to "hard" limits,
because I was for some reason convinced that it's what bash does.

* Changelog entry
  • Loading branch information
laloch authored Nov 23, 2020
1 parent 5ea2ae4 commit 7fb4d06
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
23 changes: 23 additions & 0 deletions news/ulimit-default-soft.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* ``ulimit`` builtin now operates on "soft" limits by default.

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
4 changes: 2 additions & 2 deletions xonsh/xoreutils/ulimit.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ def _ul_parse_args(args, stderr):
long_opts[_UL_RES[k][1]] = k

actions = []
# mimic bash and default to 'hard' limits
res_type = _UL_HARD
# mimic bash and default to 'soft' limits
res_type = _UL_SOFT
for arg in args:
if arg in long_opts:
opt = long_opts[arg]
Expand Down

0 comments on commit 7fb4d06

Please sign in to comment.