Commit Graph

1624 Commits

Author SHA1 Message Date
Shun Sakai
cc039e29ce Add completions for Docutils 2020-05-19 21:02:55 +02:00
Soumya
518170b299 Also call fish_job_summary for foreground sigint
The default implementation will not print any output in that case, but this provides users with additional flexibility when it comes to customising the shell's behaviour.
2020-05-19 20:39:10 +02:00
Soumya
324fa64114 Add fish_job_summary, called whenever a job ends, stops, or is signalled
This allows users to customise the behaviour of the shell by redefining the function. This is similar to how fish_title or fish_greeting behave, where the default implementation can be easily overridden.

The function receives as arguments the job id, command line, signal name and signal description.
2020-05-19 20:39:10 +02:00
Enrico Borba
f10de5f653
__fish_prepend_sudo: Toggle "sudo" on multiple presses (#7012)
At the moment calling __fish_prepend_sudo multiple times does not toggle
sudo, and also unnecessarily uses the `-c` flag to `commandline` to see if
the first token on the commandline is "sudo".

This change removes the `-c` switch and also toggles "sudo" on multiple
calls to __fish_prepend_sudo, while maintaining the cursor position and
while maintaining any spaces between "sudo" and the next token on the
commandline.
2020-05-17 11:15:15 +02:00
Johannes Altmanninger
f9447dc72f help.fish: fix help for the separate completion page 2020-05-16 11:58:12 +02:00
Johannes Altmanninger
8e18f683a7 help.fish: fix not using anchors for some help topics
The completions for help know many more help topics, it makes no sense
to whitelist them here.

Fix anchor links for tutorial sections.

Remove some dead code: the "man" branch was unreachable because of the
earlier (__fish_print_commands) case.
2020-05-16 10:34:32 +02:00
Johannes Altmanninger
ec2371fb79 Some more precautionary uses of set --local 2020-05-15 21:35:48 +02:00
Johannes Altmanninger
49c5f96470 Use set -l to force use of a local variable
Bare set overwrites a global/universal variable if it exists.
2020-05-15 08:25:07 +02:00
Johannes Altmanninger
fe6c76d058 Read into local variables in some completions
Otherwise these might modify global or universal vars.
2020-05-15 07:14:54 +02:00
Uy Ha
76bbcb9804 Add check to let Windows Terminal pass 2020-05-14 18:02:50 -07:00
exploide
1ccec532f0 __fish_print_hostnames: skip ssh host definitions containing wildcards 2020-05-14 22:34:47 +02:00
LawAbidingCactus
f71737e58a Add $fish_force_vi_cursor variable to allow cursor setting on unsupported terminals 2020-05-14 22:25:20 +02:00
Johannes Altmanninger
a8e9f560e4 fish_clipboard_copy: also copy newlines from mult-line commands 2020-05-14 21:07:37 +02:00
Fabian Homborg
ea0a0991a1 anypython: Try supported numbered python3 versions
In case someone doesn't even have a `python3` symlink.
2020-05-10 22:49:25 +02:00
Jason Nader
bb65f81e64 edit_command_buffer: Add line:col support for micro 2020-05-08 20:00:07 +02:00
Eamon Caton
b665604475 Add newline to history clear message for consistency 2020-05-08 22:36:57 +08:00
Fabian Homborg
3c6c8d5424 fish_vi_cursor: Add alacritty to the whitelist 2020-05-07 18:04:39 +02:00
David Adam
ec74c739c8 bindings: expand abbreviations with all end-of-command characters
Closes #6970.
2020-05-07 09:13:33 +08:00
Fabian Homborg
3e29b0d916 fish_vi_cursor: Allow new Konsole
It removed $KONSOLE_PROFILE_NAME and added $KONSOLE_VERSION.

Let's assume if $KONSOLE_PROFILE_NAME is set we use the old sequences,
if not we use the new ones.
2020-05-02 17:42:42 +02:00
David Adam
f36c82ce86 Reenable command descriptions on macOS 10.15.4+
Further work on #6270, as recommended in 611a6589ea.

[ci skip]
2020-05-01 21:28:43 +08:00
ridiculousfish
a1494c9c22 Revert "__fish_describe_command: print only exact match and exit"
This reverts commit 535845861a.

That commit introduced a bug where tab-completing commands no longer
prints their descriptions, unless there is an exact match.
2020-04-30 11:09:46 -07:00
hyperfekt
31cb615671 __fish_config_interactive: use __fish_anypython 2020-04-29 14:17:16 +08:00
George Christou
2bc4228d42 edit_command_buffer: Add line:col support for Sublime Text 2020-04-28 08:48:31 +02:00
LawAbidingCactus
ad677d388c fix pushd 2020-04-26 14:39:15 +02:00
Fabian Homborg
c7c10c8b10 __fish_ps: Use builtin realpath
We might want to find a better home for that builtin.
2020-04-21 21:11:26 +02:00
Fabian Homborg
18b2a65fdc Remove unused --inherit-variable 2020-04-21 21:11:26 +02:00
Fabian Homborg
6ebbe5a450 fish_clipboard_copy: Stop adding newlines
When this switched over from directly piping commandline to storing
its output and using printf, I inadvertently always added a trailing
newline. That's probably annoying.

Note that this will now always *remove* a trailing newline (because
the command substitution does). That will barely make a
difference (because trailing newlines are quite unusual in the
commandline) and will probably feel better than keeping it - we could
even make a point of removing trailing whitespace in general.

Fixes #6927
2020-04-21 07:26:27 +02:00
Jason Nader
f66285d7a1 dogfood string split -f 2020-04-20 22:39:48 +02:00
Johannes Altmanninger
9c6e81a838 Support busybox ps in process completions
Fixes #6918
2020-04-19 05:51:25 +02:00
Alan Somers
3d0581d195 fish_hg_prompt should return 1 when not in a mercurial directory 2020-04-19 04:24:28 +02:00
Joel Kuhn
a3dfa21737 Change vi-mode tilde to toggle character case
This updates the behavior of tilde to match the behavior found in vim.
In vim, tilde toggles the case of the character under the cursor and
advances one character. In visual mode, the case of each selected
character is toggled, the cursor position moves to the beginning of
the selection, and the mode is changed to normal. In fish, tilde
capitalizes the current letter and advances one word. There is no
current tilde command for visual mode in fish.

This patch adds the readline commands `togglecase-letter` and
`togglecase-selection` to match the behavior of vim more closely. The
only difference is that in visual mode, the cursor is not modified.
Modifying the cursor in visual mode would require either moving it in
`togglecase-selection`, which seems outside its scope or adding
something like a `move-to-selection-start` readline command.
2020-04-18 14:59:37 +02:00
Jouke Witteveen
93b86bbe63 systemctl completions: Use --plain where appropriate
The --plain flag drops the '●'-glyph and generally makes the output more
suitable for automated processing.
2020-04-18 11:11:27 +02:00
Jason Nader
85a8deabe9 Run fish_indent on all files 2020-04-18 10:53:11 +02:00
Johannes Altmanninger
be36c96028 alias.fish: unbreak listing aliases without backslashes
The description for an alias which already has escape sequences will
use backslash escapes for quoting; usually `string escape` can simply
quote it.  Use a regex that accepts either escaping style.
2020-04-18 09:35:33 +02:00
Johannes Altmanninger
9eb2b69a51 alias.fish: list aliases that are escaped, not quoted
Fixes #6910
2020-04-17 23:16:43 +02:00
jeanprey
052d8d3a10 Activate untracked status in hg prompt
Correction of a typo that prevented the display of untracked status on the detailed prompt.
2020-04-16 19:18:22 +02:00
Benjamin Kellermann
de9f4cb252 add completion for netcat
- implement the most common netcat variants on Linux
  - nc.openbsd
  - nc.traditional
  - nc/netcat tries to guess which netcat is currently used
2020-04-13 23:45:40 +02:00
Jason Nader
d278ff4e45 Use the new string split --fields feature 2020-04-12 14:01:21 -07:00
Charles Gould
8029f15f1f git prompt: better check for git stashes
When you run "git gc":

 - .git/refs/stash is deleted
 - .git/logs/refs/stash is kept intact
2020-04-10 00:22:16 +02:00
exploide
8025e80fdb new function __fish_preview_current_file to open file at the cursor in pager
bound to Alt+O by shared key bindings
created with help from @krobelus
fixes #6838
2020-04-07 22:30:05 +02:00
Thom Chiovoloni
39e0fd14eb Allow man completions on catalina if apropos is overridden
It's pretty easy to fix catalina's apropos with a small tweak, so it
would be nice if man completions worked if this is done.
2020-04-06 19:13:12 +02:00
Fabian Homborg
ff68bdceba Allow file completions for more builtins
- contains
- count (for `count *`)
- echo
- printf
- random (for `random choice`)

Fixes #6520
2020-04-06 18:59:10 +02:00
Fabian Homborg
6a721fab63 Let . and : be completed with files
For `.` it's *correct* and for `:` it literally accepts everything
2020-04-06 18:56:10 +02:00
Ron Gebauer
77fb54fa99 In Fish MD5 on BSD now use given String and not -s
Signed-off-by: Ron Gebauer <ron.gebauer@raytion.com>
2020-04-05 17:25:02 -07:00
Jason Nader
eaf313f755 Dogfooding to show off use case 2020-04-04 15:30:09 +02:00
Fabian Homborg
1b0ec21773 __fish_config_interactive: Remove a "is-interactive" check
This looks like a copy-paste error. If we're in
__fish_config_interactive, we're *interactive*.
2020-03-28 09:50:37 +01:00
Johannes Altmanninger
aa304cbd3d Restore directory completions for subcommands
Fixes #6798

This re-adds some false positives: functions, builtins and abbreviations
are suggested after commands like sudo but I don't think anyone had
complained about that.
2020-03-24 20:18:07 +01:00
Johannes Altmanninger
d0bedf3bbd help.fish: only use cmd.exe on WSL
Fixes #6797
2020-03-23 21:02:15 +01:00
Jason Nader
979d3a18aa help function: special case string xxx 2020-03-22 09:33:07 +01:00
Fabian Homborg
8ddd512fba Refine when we expand abbreviations
- ctrl-space will insert a space without expanding abbrs
- ")" or alt-enter will expand abbrs

Fixes #6658
2020-03-21 13:55:15 +01:00