* Added new function for the default prompt mode
Now fish mode prompt will call fish_default_mode_prompt, this will solve #3641
* Added function description
* Change wording for documentation about default mode prompt
* Finish changes requested in code review
This would fail on very long numbers, e.g.
`math "1 + 1233242342353453463458972349873489273984873289472914712894791824712941"`
would now return "42", where it previously returned the correct "1233242342353453463458972349873489273984873289472914712894791824712942".
This reverts commit 26e781ef5a.
It's not the case that macOS and old BC doesn't respect this environment
variable, just that they don't have special behavior when it's set to 0.
However, there is rather universal favorable behavior with a value of 2.
Output is of the form:
\
999999999999999999999999999999999...
with the second line being arbitrarily long. So just grab that line
instead of stitching with `string`.
This can yield a 25-30% speedup.
This commit adds a feature that after typing "git add" and pressing
"alt+h", the manpage for "git-add" instead of "git" would be displayed.
The new logic takes the first argument which doesn't start with a dash
and tries to display manpage for "command-argument"; it falls back to
"man command" it the first try doesn't succeed.
Fixes#3618.
* Only append paths if `MANPATH` is already set, to match behavior of macOS
`path_helper` utility.
* Use the same technique as is used above to set PATH from /etc/paths and
/etc/paths.d/*.
- Support completing dynamic make targets.
- Support completing make targets when using -C/--directory.
- Support `-Cdir/path`, `-C dir/path`
- Support `--directory=dir/path`, `--directory dir/path`
This detects if the make command have the `-p` switch otherwise it
assumes it is BSD make and will run a different command to try to figure
out the available targets.
Commits 48aa92900 and 77d4d21ca each added two files with the same name
differing only in letter case. That causes problems on systems like
macOS and MS Windows. Remove the lowercase file names. Anyone needing
those completions can do (same for VBoxHeadless):
function vboxsdl --wraps VBoxSDL
VBoxSDL $argv
end
The previous implementation didn't take into account that a lexer could
have multiple names and gave `cpp, c++` instead of `cpp` and `c++` when
completing `pygmentize -l c`.
--authoritative and --unauthoritative 'complete' builtin switches have no effect anymore.
This commit removes usage of --unautoritative/-u in completions.
--authoritative and --unauthoritative 'complete' builtin switches have no effect anymore.
This commit removes usage of --autoritative/-A in completions.
The recent refactoring to separate default (emacs) from vi key bindings
overlooked adding `\cH` bindings to vi mode. This also fixes the
behavior of the [del] key bindings (\x7F).
Fixes#3653
This implements a standard function and bindings for editing the command
line in an external editor. This feature has been requested multiple
times in the past year with various solutions cut and pasted into those
issues. This change combines the best aspects of those solutions.
Fixes#1215
There were two places in the code that used the anti-pattern of
returning True on success else an error message. In python you should
always be able to replace `if x == True:` with just `if x:`. Which is
what the lint tool recommended. Unfortunately I didn't notice how the
return value was being used. This fixes that by changing the two
affected functions to return an error message or None on success.
This also adds `from __future__ import print_function` since the code
uses the `print(msg)` function form rather than the `print msg`
statement form. The former works by accident on python2 because the
parens are interpreted as creating parenthesized expression that
devolves to the single string inside the parens. So while the future
import isn't strictly speaking necessary it will help avoid mistakes in
the future if more complex `print()` calls are added.
Partial fix for #3620
`abbr` used to take a single argument and split in on the first space,
but 309e10e7 and predecessors altered this behaviour. Update the web
config use of abbr to the newer format.
Fixes#3620.
I had disabled having `make style-all` restyling fish scripts because a
majority of them did not conform to the style enforced by `fish_indent`.
I recently restyled most of the fish scripts with the exception of the
completion scripts. So this re-enables restyling all scripts with the
exception of completion scripts.
The abbr function doesn't have the possiblity to rename abbreviations.
You have to delete the old one and create a new one. This commit adds
this functionality and uses the syntax:
abbr -r OLD_KEY NEW_KEY
Fixes#2155.
I hate doing this but I am tired of touching a fish script as part of
some change and having `make style` radically change it. Which makes
editing fish scripts more painful than it needs to be. It is time to do
a wholesale reformatting of these scripts to conform to the documented
style as implemented by the `fish_indent` program.
This augments the previous change for issue #3346 by adding an error
message when an invalid integer is seen. This change is likely to be
controversial so I'm not going to squash it into the previous change.
This might be a bit over the top, but getting the information that a default priority threshold is used without knowing what that value is or how to find out might not be so useful after all. Thus, change the completion to include this information dynamically.
The last commit to this auto completion changed it to use `string replace` instead of `tr`. Unfortunately they do not behave the same. `tr " = " "\t"` replaces " = " with a tabulator character, while `string replace -a " = " "\t"` replaces it with \t. Either `string` is misbehaving or this auto completion was broken.
We cannot just use TERM = xterm and defined Ss sequence, as some old
vte-based terminals are still in the wild that don't support the
sequence and don't have $VTE_VERSION set.
I have tested this on
- konsole - supported and works ($KONSOLE_PROFILE_NAME)
- new xterm - supported and works ($XTERM_VERSION)
- lxterminal-gtk3 - supported and works ($VTE_VERSION)
- new gnome-terminal - supported and works ($VTE_VERSION)
- lxterminal-gtk2 - not supported and deactivated (no $VTE_VERSION)
- tmux in konsole - works
- tmux in lxterminal-gtk2 - deactivated
and for all supported ones with the respective variable erased, to see
that it is deactivated.
Fixes#3499.
* add completions for mkvextract
* fix edge cases with option placement in mkvextract.fish
* improve resiliency to errors in mkvextract.fish
* minor fixes in mkvextract.fish
The changes related to issue #3068 removed most of the emacs bindings
from vi mode. However, since fish 2.4.0 was released several people have
pointed out that the directions for reinstating the legacy hybrid key
bindings don't work. This change fixes that and makes it easier to use
the legacy hybrid bindings.
Fixes#3556
The `status` command currently silently allows incompatible flags (i.e.,
subcommands). Too, using flags to specify subcommands misleads the user
into thinking they can specify multiple subcommands.
We recently modified the `history` command to deprecate using flags for
subcommands. This change does the same for the `status` command.
Fixes#3509
SysBench is a modular, cross-platform and multi-threaded benchmark tool for
evaluating OS parameters that are important for a system running a database
under intensive load
The dpkg-reconfigure command is used on Debian and Ubuntu based systems to reconfigure packages.
According to the relevant manpage's the commited completion file should be complete.
Use $USER, prompt_hostname, string
Update to use correct color names such as magenta over purple.
Use bright color variants instead of bold in some cases.
While working on making the history command support case-sensitive and
insensitive searches I noticed that entering "all" when interactively
deleting history entries resulted in an error. That's because the
history builtin currently only supports `--exact` so we need to loop
over the matching entries and delete them one at a time.
Fixes#3448
My previous change to avoid creating a *.pyc file when running
create_manpage_completions.py was wrong because I put the
`sys.dont_write_bytecode = True` on the wrong line. Rather than simply
move that statement make the simpler, cleaner, fix that removes the need
for `eval` where that program is invoked.
The Linux kernel only splits on the first whitespace in the shebang line
(unlike BSD which splits on all whitespace). Which means there can be
only one argument after the path to the program.
Producing man pages is done infrequently (basically just at `make test`
and `make install`) so there isn't any point in writing compiled
byte-code versions of the python modules.
After implementing `builtin fish_realpath` it was noticed that it did
not behave like GNU `realpath` without options. Which is super annoying
since that was the whole point of implementing the command. Major
failure on my part since I wrote the unit tests to match the behavior of
the existing `wrealpath()` function that I simply exposed as a builtin
command. Rather than actually verifying it behaved in a manner
compatible with GNU realpath.
Also, while the decision to call the builtin `fish_realpath` seemed to
make sense at the time of the original commit further reflection has
shown that to be a silly, idiosyncratic, thing to have done. So rename
it to simply `realpath`.
Fixes 3400
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