This was printed basically everywhere.
The user knows what they executed on standard input.
A good example:
```fish
set c (subme 513)
```
used to print
```
fish: Too much data emitted by command substitution so it was discarded
set -l x (string repeat -n $argv x)
^
in function 'subme'
called on standard input
with parameter list '513'
in command substitution
called on standard input
```
and now it is
```
fish: Too much data emitted by command substitution so it was discarded
set -l x (string repeat -n $argv x)
^
in function 'subme' with arguments '513'
in command substitution
```
See #5434.
Now:
```
cd: Unknown option '-r'
~/dev/fish-shell/share/functions/cd.fish (line 40):
builtin cd $argv
^
in function 'cd' with arguments '-r'
in function 'f'
in function 'd'
in function 'b' with arguments '-1q --wurst'
in function 'a'
called on standard input
```
See #5434.
This printed things like
```
in function 'f'
called on standard input
in function 'd'
called on standard input
in function 'b'
called on standard input
in function 'a'
called on standard input
```
As a first step, it removes the empty lines so it's now
```
in function 'f'
called on standard input
in function 'd'
called on standard input
in function 'b'
called on standard input
in function 'a'
called on standard input
```
See #5434.
This switches env_var_t to be an immutable value type, and stores its
contents via a shared_ptr. This eliminates string copying when fetching
env_var_t values.
If a function process is deferred, allow it to be unbuffered.
This permits certain simple cases where functions are piped to external
commands to execute without buffering.
This is a somewhat-hacky stopgap measure that can't really be extended
to more general concurrent processes. However it is overall an improvement
in user experience that might help flush out some bugs too.
In a job, a deferred process is the last fish internal process which pipes
to an external command. Execute the deferred process last; this will allow
for streaming its output.
This searched for package.json in any parent, so just like finding
.git and .hg directories it _needs_ to use the physical pwd because
that's what git/hg/yarn use.
In general, if you do _any_ logic on $PWD, it should be the physical
path. Logical $PWD is basically only good for display and cd-ing
around with symlinks.
[ci skip]
This merges a bunch of changes that clean up how the reader loop and input
works.
Prior to this fix, we abused wchar_t by cramming readline functions into
"private" regions. Readline functions then were further abused with
meta-readline functions like R_NULL or R_TIMEOUT.
This fix introduces a new type char_event_type_t which wraps up the "meta"
character types. A char event may be a null (try again), timeout, readline,
or real input character. These are all distinct values.
The reader loop is then refactored to handle these cases separately.
I believe this was selected to be artificially low for the sake
of it displaying well in prompts. But people should expect to get
the same output as can be gotten from `hostname`.
Fixes#5758
This called `eval $fish_browser --version` to figure out if it is
lynx.
That's really not worth it just to support edge-cases using a rather
unusual browser, to work around a bug in it.
Instead we just see if the browser name starts with "lynx", which
should work in 99.9% of cases.
This merges in a number of improvements specifically aimed at console
sessions (i.e. using fish at the tty, not over SSH or in an X-based
terminal emulator). When a console session is detected, the system
wcwidth is used to line up width info between fish and the system tty,
and only simple characters are used as symbols.
Tested under Linux, macOS, FreeBSD, Solaris, Cygwin, WSL, and others.
Closes#5552. Ref #789, #3672.
The code already allowed for variable width (multicell) *display* of the
newline omitted character, but there was no way to define it as being
more than one `wchar_t`.
This lets us use a string on console sessions (^J aka newline feed)
instead of an ambiguous character like `@` (used in some versions of
vim for ^M) or `~` (what we were using).