Commit Graph

587 Commits

Author SHA1 Message Date
Fabian Homborg
616d848fac Add .fish suffix to funced's tempfile name
This allows editors (like emacs) to pick up on the fact that it's a fish script.
2015-07-19 17:22:09 -07:00
Jesse Nazario
466806fb11 ctrl-p as up-or-search and ctrl-n as down-or-search 2015-07-19 17:13:44 -07:00
Vladimir Rudnyh
d49f6e1b29 __fish_git_prompt: fix stateseparator color in informative_status
In informative_status mode stateseparator did not use
fish_git_prompt_color settings.
2015-07-12 14:53:52 -07:00
David Woods
4a3cda1495 update function parameter for EXIT signal
changed `function __trap_handler_EXIT --on-exit %self` to `function __trap_handler_EXIT --on-process-exit %self`

I'm guessing the on-exit syntax was from an older version? Trapping EXIT with that syntax caused errors.
2015-07-12 14:21:05 -07:00
Derek Harland
05daedf7c6 Improve dirs output and add -c option
Adds behaviour similar to bash:
- shorten dirs output by representing $HOME as ~;
- provide a '-c' option to clear the stack
2015-07-12 12:20:44 -07:00
Derek Harland
f07d59c55d Alter pushd to add more bash-like behaviour
The following behaviour is added:
- an empty pushd exchanges the top two directories in the stack;
- pushd +<n> rotates the stack so that the n-th directory (counting from the left of the list shown by dirs, starting with zero) is at the top;
- pushd -<n> rotates the stack so that the nth directory (counting from the right of the list shown by dirs, starting with zero) is at the top.
2015-07-12 11:57:14 -07:00
Fabian Homborg
25d19f7d63 Add completions for systemd's machinectl 2015-07-02 14:36:48 +08:00
David Adam
976ce1e8fd Add completions for Debian's Apache tools, a2{en,dis}{mod,conf,site}
Work on #2141.
2015-06-26 16:14:01 +08:00
David Adam
7d94b7fd1b __fish_print_hostnames: ignore errors from getent
Closes #2137.
2015-06-19 16:42:48 +08:00
ridiculousfish
4115a2f2d1 Tweak and add tests for abbr
1. When run with no arguments, make abbr do the equivalent
   of `abbr --show`
2. Enable "implicit add", e.g. `abbr gco git checkout`
3. Teach `abbr --show` to not use quotes for simple cases
4. Teach abbr to output -- when the abbreviation has
   leading dashes

Add some basic tests to abbr too.
2015-06-14 14:12:29 -07:00
ridiculousfish
767742c7e7 Rework how the mode is reported in fish_vi_mode
Add a new function fish_mode_prompt which (if it is defined) has its output
prepended to the left prompt. Rather than replacing the prompt wholesale, make
fish_vi_mode enable this function by setting a variable __fish_vi_mode. This
enables vi mode to interoperate nicely with custom prompts. Users who want
to change how the mode is reported can either redefine this function or
erase it entirely. Fixes #1988.
2015-06-14 11:36:11 -07:00
David Adam
18d7465592 Merge branch 'Integration_2.2.0' 2015-06-05 14:02:25 +08:00
David Adam
b6b6de3304 vi bindings: clear commandline with Ctrl-C
Closes #2077.
2015-06-05 14:01:43 +08:00
Michael Steed
cb984cf761 Add 'bigword' vi key bindings
- Add four new functions: forward-bigword, backward-bigword,
  kill-bigword, backward-kill-bigword
- Add new enum move_word_style_whitespace and related state machine
  method
- Change vi key bindings to operate on bigwords: B, gE, W, E, dW, diW,
  daW, dE, dB, dgE, cW, ciW, caW, cE, cB, cgE, yW, yiW, yaW, yE, yB,
  ygE
2015-06-04 12:09:02 -07:00
ridiculousfish
3a190bbe49 Revert "Notify vte-based terminals when a command completes."
Backing out fix for #2096 until we know how to avoid
spamming other terminals (#2102)

This reverts commit 5c4acc8ee1.
2015-05-30 11:57:31 -07:00
Ben Liblit
5c4acc8ee1 Notify vte-based terminals when a command completes.
Notification is sent using an OSC 777 escape sequence as described at
http://known.phyks.me/2014/local-notifications-for-weechat-and-urxvt.
The specific notification is crafted to match that emitted by bash
when running under Fedora 22 with the "vte-profile" RPM installed.
See the code for "__vte_prompt_command" starting at
http://pkgs.fedoraproject.org/cgit/vte291.git/tree/vte291-command-notify.patch#n307
to see exactly what bash produces.  My approach is, however, a bit
more paranoid about control characters embedded in commands.

Gnome-terminal 3.16 responds to this escape sequence by posting a
desktop notification if the containing terminal window does not have
focus.  This lets the user know that a long-running background command
has completed.  Job notification is promoted as a Fedora 22 feature
(http://fedoramagazine.org/terminal-job-notifications-in-fedora-22-workstation/),
so it would be good for fish users to be benefit from it.

Conversely, anyone who does not want this feature can use "functions
--erase __notify_vte_command_completed" to turn it off.
2015-05-28 03:10:56 -05:00
David Adam
c0cf25cf0b abbr: rename --remove to --erase
for consistency with other fish commands

Closes #2071.
2015-05-22 09:48:39 +08:00
ridiculousfish
7a1fc028e3 Only pass the command name to command-not-found
With the fix for #365, fish_command_not_found event handlers
receive the command and all of its arguments. But commands
like /usr/lib/command-not-found expect only the command name.
So when invoking an external command, just pass the command
name, not all of the arguments.
2015-04-20 02:22:54 -07:00
ridiculousfish
97aa1c033b Switch back to insert mode after executing a command in vi mode
Fixes #1933
2015-04-08 10:31:48 -07:00
ridiculousfish
87428672d8 Fix funcsave to not delete the function it just created
In 73f344f41b, we allowed autoloaded functions to be deleted.
For some reason, funcsave immediately deletes the function it
creates. This previously did very little, since the function would
immediately be re-autoloaded, but with the fix for 73f344f41b
the function gets tombstoned. So the effect is that funcsave
makes the function disappear! This simply removes the erase call,
which dates back to fish 1.x.
2015-04-06 22:40:13 -07:00
Sanne Wouda
cad1dc5293 Fix #1978:"ul: unknown escape sequence" when asking for help
It seems that `ul` can't handle the escape sequences for bold text that `nroff` generates on my system.  Fixed by either removing `| ul`, or adding `-c` to the `nroff` command.

Needs testing for old (OSX?) versions of nroff.
2015-04-04 12:03:58 -07:00
David Adam
900a8a1408 __fish_complete_python: fix regex to be POSIX-compatible
Closes #2004.
2015-03-30 15:13:04 +08:00
David Adam
384cb2d735 Revert "__fish_config_interactive: warn users that fishd is going away"
This reverts commit ad61c3f0d6.

Work on #1730.
2015-03-30 13:42:59 +08:00
David Adam
ad61c3f0d6 __fish_config_interactive: warn users that fishd is going away
Work on #1730
2015-03-26 16:24:52 +08:00
David Adam
48d353610f abbr: coalesce multiple arguments to --add
Makes the behaviour of the script match the documentation.
2015-03-13 16:32:05 +08:00
Fabian Homborg
16e65c849c systemctl completions: Only list matching units on enable/disable 2015-03-06 23:05:24 -08:00
Fabian Homborg
33c0d93b20 systemctl completions: Add more unit types and commands
It should now support all unit types mentioned in systemd.unit(5)
2015-03-06 23:05:24 -08:00
Fabian Homborg
3e32715693 systemctl completions: Support user-mode 2015-03-06 23:05:24 -08:00
David Adam
597dda5a4b isatty: use command test instead of redirections
Adds a fork but can't use builtin test yet.

Closes #1870.
2015-02-01 18:18:34 +08:00
David Adam
66acd17bc0 isatty: revert to previous behaviour
This partially reverts commit 60808a4820.
2015-02-01 18:18:34 +08:00
T. Jameson Little
793784c087 Add command-not-found handler for Arch Linux
- checks for `pkgfile`, which is an optional (but official)
  package used for searching for packages given a file
2015-01-30 22:01:40 -07:00
LoveIsGrief
facfe33218 Add function to ouput hg branch and status for a prompt
This is an adaptation of terlar's git prompt output
2015-01-30 23:07:40 +08:00
David Adam
028d9e8e3b default key bindings: ignore FocusIn/FocusOut control sequences
Closes #1917.
2015-01-30 16:01:25 +08:00
Max Gonzih
dce487380c Fix not found handler for fedora 2015-01-18 11:52:15 +01:00
ridiculousfish
75a76c596c Clean up recent fix for #1892
Restore 906d235 and simplify how __fish_restore_status works
2015-01-17 15:36:30 -08:00
Jelte Fennema
9e3f912747 Ignore error message when not on a Gentoo system 2015-01-17 11:51:36 +01:00
Konrad Borowski
e529b78365 Don't define unnamespaced internal function. 2015-01-17 11:50:23 +01:00
Jorge Bucaran
2018b9b217 Fix: eval should preserve previous $status if the evaluated block does not change it
Empty functions may return 1 when eval is used due to the $status not being correctly preserved inside the function definition.
2015-01-17 11:44:55 +01:00
ridiculousfish
906d235601 Add more expository comments to eval, and remove a useless parameter 2015-01-07 14:56:41 -08:00
Andreas Heiduk
a0127a0c7a Change fish_paginate to paginate both stdout and stderr. 2014-12-28 23:14:13 +08:00
Max Gonzih
46cd89c2db Support nixos command-not-found handler 2014-12-22 11:16:36 +08:00
Rack Lin
bfd1951023 Added export alias for set global variable, made for sh/bash/zsh compatibility
Signed-off-by: Rack Lin <racklin@gmail.com>
Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au>
2014-12-01 15:43:57 +08:00
David Adam
c78e56c509 Update various strings for translation, avoid _ for non-translations
Use __ instead of _ as a placeholder for ignored variables in `read`
statements.
2014-11-25 15:37:30 +08:00
David Adam
190cac07a3 grep.fish: don't set GREP_COLOR
grep will fall back to the default colors.

Closes #1316.
2014-11-25 08:48:16 +08:00
David Adam
efc3846fcf grep.fish: don't use GREP_OPTIONS as it is deprecated
Closes #1825.
2014-11-25 08:47:30 +08:00
David Adam
918d5595bd __fish_config_interactive: send CWD via escapes in Apple Terminal
Closes #68.
2014-11-20 14:45:11 +08:00
David Adam
0abdf9eeff __fish_urlencode: rework to behave properly on BSD/OS X
Work on #68.
2014-11-20 13:53:24 +08:00
David Adam
14fa48864a abbr.fish: escape the output of abbr --show
Allows abbreviations containing embedded newlines, etc., to be displayed
and exported properly.

Work on #731.
2014-11-16 23:13:22 +08:00
David Adam
206ea15b68 abbr.fish: improve support for corner cases
Handle unusual cases ('=abc', ' =abc') better - regression from
8e8e6314due to a7bab7b.

Work on #731.
2014-11-16 23:05:58 +08:00
David Adam
a7bab7b18b abbr/web_config: support space-delimited abbreviations
Support for space-delimited abbreviations was added to the expansion
parser in fbade198; this commit extends that support to the user-facing
tools, and documents the space-separated behaviour. Equals-delimited
abbreviations are expected to be removed before the next release.

Work on #731.
2014-11-15 23:48:40 +08:00