This adds a flag to the `history search` command to limit the number of
matching entries to the first "n". The default is unlimited. This is
mostly useful in conjunction with aliases (i.e., functions) that are
intended to report the "n" most recent matching history entries without
piping the result through the user's pager.
Fixes#3244
Don't wrap fish_indent at all if the version in $PATH matches
$FISH_VERSION.
When we do wrap it, resolve the path once, and use that via alias
machinery instead of doing an eval each time.
In both cases, `type fish_indent` can tell us what it's actually going
to do now.
clarity aside, it's faster if we only eval the one time.
eval is not only evil, but slow.
> for h in $history[1..100]; echo $h | fish_indent --no-indent; end
before: CMD_DURATION = 1005
if fish_indent is kosher in PATH: 549
if not, using alias: 687
these modern terminals both compose a nicer title if we don't try to provide a custom one (no path in title twice, "fish" in title twice) - and the user can configure which components they'd like in their terminal inside the terminal preferences.
Also make test "$VTE_VERSION" -ge .. work once I commit `test` strtoi
fix - the trick is to add a zero before it so the numeric comparison
works even if it's empty.
Fixes#107
This deprecates the use of long options for history sub-commands (e.g.,
`history --delete`) in favor of proper sub-commands (e.g., `history
delete`). It also eliminates the short options for those sub-commands.
Also change option processing to allow options anywhere on the command
line to match how the vast majority of fish builtins handle flags.
Replace --with-time with --show-time.
Fixes#3367
* Use 'grealpath' if installed for realpath fallback
See discussion in #3370
* fish_realpath: filter out dangerous options
Per feedback do not use aliases to declare wrapped functions.
chown completion chown currently uses cat /etc/group to fetch the list of group names. In Cygwin there's no /etc/group file any more (user and group names are fetched directly from the OS), so when a user tries to tab-complete the group name they get an error message:
ASchulma@LZ77E1AASCHULMA ~/d/fish> chown ASchulma🐱 /etc/group: No such file or directory
This change fixes that by using getent group (via __fish_complete_groups) by preference to get the group names, and falling back to /etc/group. This is more portable.
This has the same name and path as ubuntu's, but takes less arguments.
So we need to actually find if the distro thinks it is suse, and then
use it.
Fixes#3366.
Adds a color reset thing, to ensure fish tries to use hard colors during
testing.
Also, work on a discrepancy (not introduced by my changes, afaik) when
with some combinations of color settings, and usage of --bold, caused super
flakey color paninting in the pager. Downwards movements that trigger
scrolling vs. upwards movement in the pager would only apply bold to
selections when moving upwards. The bold state of the command completions in
the pager was flipping flops on and off, depending on if there is a description
on the preceding line.
Implement a lame fix by reseting the color to normal and applying a
different style on the rightmost ')' which seems to be what was influencing it.
Makes fish use terminfo for coloring the newline glich char.
The previous solution would not erase the previous bindings if
fish_vi_key_bindings was called with a mode argument. So if the user
switched to vi with a different initial mode, they'd keep their previous
bindings also.
Supersedes e89057b.
Some of these were defined in the shared bindings, some (like \cy yank)
were just literally duplicate in the same files.
This should _not_ change anything. In particular this does not remove
hardcoding of sequences (because terminfo might be wrong or the term
might need smkx).
Found with
```
function bind
set -l binds (builtin bind)
builtin bind $argv
set -l newbinds (builtin bind)
if set -q argv[1]; and not test "$argv[1]" = "--erase"
if test "$binds" = "$newbinds"
echo "Duplicate: " (string escape -- $argv)
end
end
end
```
The vi-bindings function would unconditionally erase all bindings,
making it impossible to call it last. This would disable the
mode-indicator (and in future also the cursor).
Make it so any argument to fish_vi_key_bindings stops it from erasing
bindings.
It would also be possible to demand an argument to erase (or to erase as
a separate step). but the usual case seems to be _switching_ to a set of bindings.
This didn't work on platforms where tput exists but can never accept
terminfo names. This includes the current versions of FreeBSD - it
used to do both, now it doesn't. So, fall back to the old termcap names
by (tput smso; or tput so). Add check for the tput program before we
even try.
The extra things `eval` does are all for code that runs
interactively. Because we just define a function, we don't need it.
This improves alias' performance by about 20-25% (0.783608s to 0.585585s
on about 500 aliases) and avoids triggering #3345.
This can be prohibitively slow on large repositories (minutes!).
While regrettable, no user is going to like waiting that long.
Work towards #3342, rerun of #3230.
Many thanks to @gladhorn for the idea!
Offering auto completion for existing commits is great, but on big
repositories, it suddenly becomes really slow, even with fast hard
disks, since each commit is read and then a line processed for it.
Instead limit to the last 500 commits (arbitrary number) which still
feels fast. Going back further in history can easily and more reasonably
done with git log etc.
* completions/p4.fish
* Updated per comments + added p4 clients
* p4 completions: integ, opened, reopen. "default" CL support.
* Perforce RCS -> SCM
* p4 reopen: list opened files
* Fixed per review, added -d for all functions
Fixed per comments in review by @faho,
Added -d for all functions,
Renamed ”subcommand" term to “command” (so there’s probably diff noise)
* p4 completions with submit list of files
* p4 completions for submit: lists open files
Implementing the --shadow-builtin flag has proven to be highly controversial.
Revert the introduction of that flag to the `function` command. If someone
shoots themselves in the foot by redefining a builtin as a function that's
their problem and not our responsibility to protect them from doing so.
Fixes#3319