The line offset of a trailing newline on the commandline was computed incorrectly.
As a result, up-arrow did not work for a commandline like the one inserted by:
commandline -i echo '' ''
Note this and the previous commit in the changelog.
Enter a multiline commandline, for example using
commandline -i echo echo
And press down-arrow. This will start a new history search which fails.
Then press up-arrow. I expect the cursor to move up, however, because we
are still in history search mode, up-or-search will search instead of moving
the cursor. Correct that by stopping history searches that don't have any results.
This needs to have the vi-bindings take precedence, so they need to be
executed *last*.
It just needs to tell them that they shouldn't erase all the bindings.
[ci skip]
These passed " [" to __fish_print_pipestatus as the left brace.
If the color contained a background, that would also color the space
in, leading to a weird unbalanced space before and none after.
Instead, prepend the whitespace when printing later.
[ci skip]
* fix Subversion prompt
- after switching to "string match", some SVN status symbols need
proper escaping
- the __fish_svn_prompt_flag_names list was missing
"versioned_obstructed" and was therefore not in line with
the symbols from __fish_svn_prompt_chars
- when checking for individual SVN status symbols, use
"string match -e" to handle the case where multiple different
symbols appear in one status column
- use "sort -u" before merging all symbols from a column into
one line
Fixes#6715
* use regex for SVN status matching
Using regex matching will prevent different match behaviour
depending on qmark-noglob feature.
Also, counting the resulting matches is unnecessary.
* use list instead of string for SVN status
Make $column_status a list be not removing newlines from SVN status
output. This makes checking for the individual status types within
a column easier because it doesn't require regex matching.
* added quotes for string length test (-n)
Instead of informing the bell character (hex 07), the example was using
an escaped \ followed by x07.
$ echo \\x07
\x07
$ echo \x07
$ echo \x07 | od -a
0000000 bel nl
0000002
$
* docs: Use \u instead of \\u
Instead of informing the Unicode character 慡, this example was using an
escaped \ followed by u6161.
$ echo \\u6161
\u6161
$ echo \u6161
慡
Before:
$ string escape --style=var 'a1 b2'\\u6161 | string unescape --style=var
a1 b2\u6161
Now:
$ string escape --style=var 'a1 b2'\u6161 | string unescape --style=var
a1 b2慡
Just as `math "bitand(5,3)"` and `math "bitor(6,2)"`.
These cast to long long before doing their thing,
so they truncate to an integer, producing weird results with floats.
That's to be expected because float representation is *very*
different, and performing bitwise operations on floats feels quite useless.
Fixes#7281.
Prior to this change, if we saw more than one repaint readline command in
a row, we would try to ignore the second one. However this was never the
right thing to do since sometimes we really do need to repaint twice in a
row (e.g. the user hits Ctrl+L twice). Previously we were saved by the
buginess of this mechanism but with the repainting refactoring we see
missing redraws.
Remove the coalescing logic and add a test. Fixes#7280.
If you expand an abbreviation by executing the command, fish uses a
synchronous mode of syntax highlighting that performs no I/O, because we
want to highlight the abbreviation but don't know if it's valid or not
without doing I/O. However we were doing this too aggressively, after
every command regardless of whether it contained an abbreviation. Only
do this for commands with abbreviations.
When typing into the command line, some actions should trigger repainting,
others should kick off syntax highlighting or autosuggestions, etc. Prior
to this change, these were all triggered in an ad-hoc manner. Each
possible
This change centralizes the logic around repainting. After each readline
command or text change, we compute the difference between what we would
draw and what was last drawn, and use that to decide whether to repaint
the screen.
This is a fairly involved change. Bugs here would show up as failing to
redraw, not reacting to a keypress, etc. However it better factors the
readline command handling from the drawing.
Because TERM was set to something other than 'dumb', we were subject to
syntax highlighting and other interactive features that would affect the
output. In practice we were getting lucky timing-wise, but with upcoming
interactive changes syntax highlighting started to fail this test.
This adds a "fish_greeting" function that prints the variable of the
same name.
In doing so, it makes $fish_greeting default to a global
variable (this is of little cost because of the `_` builtin)
This means that:
- We have fewer universal variables by default
- If we change the default greeting people will actually get
- it (unless they have a leftover universal, of course)
- If the user changes their language the variable changes with it
`go run` compiles and runs a go program passing along the trailing args to the compiled program. Limiting `go run` to only complete *.go files means that if you are running a go file that takes a file path as a command line argument, you frustratingly cannot use tab completion.
With the prior commit, the topic_monitor only writes to the pipe if a
thread is known to be waiting. This is effectively a binary semaphore, and
on systems that support anon semaphores (yes Linux, but not Mac) we can use
them. These are more efficient than self-pipes.
We add a binary_semaphore_t class which uses sem_t if sem_init succeeds,
and a self-pipe if it fails.
On Linux the seq_echo benchmark (run 1024 times) goes from 12.40 seconds to
11.59 seconds, about an 11% improvement.
The topic monitor is what allows a thread to wait for any of a set of
events. Events are identified by a bit in a "pending update" mask. Prior to
this fix, post() would atomically set the bit, and if it was newly set,
announce the change by unconditionally writing to a self-pipe. Threads
could wait for new posts by reading from the pipe.
This is less efficient than it could be; in particular if no thread is
waiting on the pipe, then the write() is unnecessary. This slows down our
signal handler.
Change the design in the following way: if a thread is committed to
waiting, then it atomically sets the "pending update" mask (now just called
status) to a sentinel value STATUS_NEEDS_WAKEUP. Then post() will only
write to the self-pipe if it sees that there is a thread waiting. This
reduces the number of syscalls.
The total effect is hardly noticeable (usually there is a thread waiting)
but it will be important for the next commit.