Age | Commit message (Collapse) | Author |
|
POSIX comes up with such silly names sometimes...
This builtin does nothing. at all.
|
|
Note that `execvp` has a default value for PATH (both on Serenity and on
Linux) and so this does not 'fix' #11608.
|
|
Some variables depend on its value to function correctly.
Fixes the following issue:
$ false; echo $?
1
$ false
$ echo $?
128
|
|
Before this patch, `which ""` or `type ""` would say that the empty
string is `/usr/local/bin/`.
Convert callers to consistently call is_empty() on the returned string
while we're at it, to support eventually removing the is_null() String
state in the future.
|
|
Naturally, this means that a command with a failing redirection will
not start, and so will terminate the pipeline (if any).
This also applies to the `exit` run when the shell is closed, fixing a
fun bug there as well (thanks to Discord user Salanty for pointing that
out) where closing the terminal (i.e. I/O error on the tty) with a
failing `exit` command would make the shell retry executing `exit` every
time, leading to an eventual stack overflow.
|
|
|
|
|
|
|
|
|
|
Fixes #10128.
|
|
|
|
And also try_create<T> => try_make_ref_counted<T>.
A global "create" was a bit much. The new name matches make<T> better,
which we've used for making single-owner objects since forever.
|
|
The new Statistics utility is now used when calling 'time -n' to get
some more information of the timings. For now only the standard
deviation is given in addition to the average.
This commit completely undos #9645 because everything that touched moved
into AK::Statistics.
|
|
This builtin was doing a lot of redundant work, including doing a stat()
followed by a chdir(), when just a chdir() would suffice.
SonarCloud: https://sonarcloud.io/project/issues?id=SerenityOS_serenity&issues=AXuVPAHNk92xXUF3qTNb&open=AXuVPAHNk92xXUF3qTNb
|
|
This kinda sorta addresses the Shell side of #9655, however the fact
that `chdir` (and most other syscalls that take paths) are artifically
limited to a length of PATH_MAX remains.
|
|
|
|
|
|
|
|
Not performance sensitive, but perhaps a bit neater? :^)
|
|
You can now specify a number of iterations when timing a command.
The default value is 1 and behaves exactly as before.
If the iteration count is greater than 1, the command will be executed
that many times, and then you get a little timing report afterwards with
the average runtime per iteration, and also the average runtime
excluding the very first iteration. (Excluding the first iteration is
useful when it's slowed down by cold caches, etc.)
This is something I've been doing manually forever (running `time foo`
and then eyeballing the results to headmath an average) and this makes
that whole process so much nicer. :^)
|
|
Add shell unalias builtin to remove aliases
|
|
|
|
Since this is always set to true on the non-default constructor and
subsequently never modified, it is somewhat pointless. Furthermore,
there are arguably no invalid relative paths.
|
|
|
|
|
|
|
|
|
|
We had some inconsistencies before:
- Sometimes "The", sometimes "the"
- Sometimes trailing ".", sometimes no trailing "."
I picked the most common one (lowecase "the", trailing ".") and applied
it to all copyright headers.
By using the exact same string everywhere we can ensure nothing gets
missed during a global search (and replace), and that these
inconsistencies are not spread any further (as copyright headers are
commonly copied to new files).
|
|
|
|
Fixes #6578.
|
|
|
|
This makes it more symmetrical with adopt_own() (which is used to
create a NonnullOwnPtr from the result of a naked new.)
|
|
Previously this didn't work:
$ cd -- /usr
Invalid path '--'
This path fixes this issue and removes the unnecessary else
branch because we're already using realpath() later on to resolve
relative paths.
|
|
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
|
|
This fixed some tests that were failing.
Thanks @alimpfard for this fix!
|
|
|
|
This fixes `fg` and `bg` causing the shell to go into an infinite loop
of trying to `waitpid` until some current job changes state.
a.k.a. "Fix Shell backgrounding, yet again!" :P
|
|
Good-bye LogStream. Long live AK::Format!
|
|
|
|
Non-interactive shells (i.e. when running scripts) do not need this
functionality, so they are a boatload of wasted time.
This significantly reduces the script startup and shutdown times when
there are lots of executables in PATH or lots of entries in the history.
|
|
`not` just takes a command, runs it, then negates its exit code (0->1,
non-zero->0).
|
|
Pretty useful for debugging.
|
|
|