Commit Graph

1460 Commits

Author SHA1 Message Date
Fabian Homborg
6157a9a858 Fix wesnoth completion 2015-08-10 19:01:50 +02:00
Fabian Homborg
6b92c4867d Fix source completion by making "..fish" symlink regular file
Also fixes #2286 by removing the only symlink.
2015-08-09 23:10:17 +02:00
Jonas Hietala
5238ed309f Match the whole real home directory in prompt_pwd. 2015-08-08 23:19:01 +02:00
Nicholas Maccharoli
f6ab0b4d07 Making spacing of .fish files uniform. 2015-08-08 11:22:44 -07:00
Fabian Homborg
db5c02fbfc abbr completions: Describe abbreviations with what they abbreviate
i.e. "abbr -e <TAB>" will list
	 am (alsamixer)
2015-08-06 20:15:36 +02:00
Mike Meyer
938da3039d Fix extra redirection. 2015-08-06 18:43:26 +02:00
faho
cfeae48b83 Merge pull request #2267 from mwm/fossil-completions
Various fossil completions fixes
2015-08-06 14:04:53 +02:00
Fabian Homborg
50f18ddaad Cower: Enable description and ignore errors when search string is too short 2015-08-06 12:57:40 +02:00
Fabian Homborg
2874650802 gpg: Fix key/user id completion
This was too simplistic, among other things it completed things that
looked like key ids but weren't, didn't turn "\x3a" back into
colons (which made the argument invalid)....

gpg is weird.

Might fix #2150
2015-08-05 22:38:42 +02:00
Fabian Homborg
1271de321e gpg: send-keys takes a key id, not a user id 2015-08-05 22:36:12 +02:00
Fabian Homborg
a265ee6f6f gpg completion: Add "-k", don't append "," so much 2015-08-05 21:59:58 +02:00
Fabian Homborg
e196203320 Add completion for systemd's timedatectl 2015-08-05 17:45:36 +02:00
Fabian Homborg
33d062cb60 pacman completion: Offer "command-options" first 2015-08-05 17:43:15 +02:00
Fabian Homborg
53bcd4b1ab Add iptables completion
This is far from perfect, but I need to gather more feedback.
2015-08-05 17:41:14 +02:00
Fabian Homborg
385f961b29 systemctl: Add new options from 220 2015-08-05 17:38:58 +02:00
Fabian Homborg
eada714a0a Complete machines in systemd tools 2015-08-05 17:38:17 +02:00
Fabian Homborg
66f11e9bd3 vi-mode: Make \cc go to normal from insert mode
Keep the behavior for normal mode

Fixes #2228
2015-08-04 14:22:55 +02:00
Mike Meyer
158d3cc743 Many small fixes, and done big one.
Bit one: Make all the fossil command invocations throw away stderr so we don't
get annoying messages when not in a repository.

Also:
- Move checkout into alphabetical order.
- Fix ls to complete against tags for -r option, not no option.
- Add missing option to delete command.
- Make commit complete against modified files.
- Make add only complete against extra files.
- Remove now ununused function to list extra & modified files.
- Add -f option in a number of places where it seemd appropriate.
2015-08-04 06:51:51 -05:00
Mike Meyer
618a4b42ad Fix type, add tag completion to checkout. 2015-08-03 17:16:44 -05:00
Mike Meyer
e2c81e54e2 Add completions for fossil checkout. 2015-08-03 16:11:26 -05:00
Fabian Homborg
546ba888ae Complete commands in pacman again
"noopt" was mistakenly turned around by missing a "not".
2015-07-31 22:36:00 -07:00
David Adam
9b2a17eb1e functions/history.fish: whitespace only change
Run through fish_indent, mismatching indents actually confusing.

[skip ci]
2015-07-31 17:12:16 +08:00
David Adam
a7ecc0db1f functions/history.fish: validate command line arguments in wrapper
Closes #2055.

Implements the standard `--` option for delimiting options from
arguments; to search for "--", use `history --search -- --`.
2015-07-31 17:07:27 +08:00
Joshua Elliott
bc7eb39781 Improve completion for python -m flag 2015-07-30 16:04:39 -06:00
Lars Grefer
b1ed15a07a Tab-Completition for atom 2015-07-29 09:58:19 +08:00
Lars Grefer
9dc6ef6771 Tab-Completition for sass 2015-07-29 03:43:31 +02:00
David Adam
d3a0372e89 grep completions: remove trailing end statement 2015-07-26 00:16:48 +08:00
David Adam
d1d36cc9af Merge branch 'death_of_mimedb' 2015-07-25 13:04:28 +08:00
PythEch
b32f770a69 Fix Unknown Signal 'winch'
Fixes an annoying error that affects machines with Turkish locales
2015-07-24 08:56:14 -07:00
David Adam
78d4f22ce4 __fish_print_mounted: expand scope on non-Linux platforms 2015-07-24 18:35:10 +08:00
Fabian Homborg
3925929979 Fix mountpoints with spaces on linux
Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au>
2015-07-24 18:33:35 +08:00
David Adam
60fdd71f74 read: update completions
--right-prompt added in fe9cf673a2 but missed from the
completions.

With thanks to nafg@github.
2015-07-24 18:18:10 +08:00
Lars Grefer
821e8ec59a Completion support for the main commands of the travis command line tool 2015-07-24 02:29:53 +02:00
David Adam
6c668868e9 death of mimedb: remove mimedb from the tree 2015-07-23 14:35:35 +08:00
David Adam
6add8a7df9 open: drop mimedb dependency 2015-07-23 14:26:38 +08:00
David Adam
7fa69ef8be __fish_complete_suffix: don't provide file description by default
Drops dependency on the mimedb tool and reflects the changes made to the
default chooser for files in #279.
2015-07-23 14:26:38 +08:00
David Adam
f77f71c17e __fish_{filter,complete}_mime: drop from tree
These are undocumented and unused, and rely on mimedb which is being removed
from the tree.
2015-07-23 14:26:38 +08:00
Fabian Homborg
3b0805f4d7 Normalize *diff completions 2015-07-20 15:19:03 -07:00
Fabian Homborg
0c1485c325 Normalize *grep completions 2015-07-20 15:19:03 -07:00
Fabian Homborg
86554d66d0 Indent svn completion
Seems emacs' fish-mode sometimes breaks
2015-07-20 15:19:03 -07:00
Fabian Homborg
6475d763d0 Remove function and descriptions from rc-service completion
The descriptions are "Start: Start the service"
				 	 "Stop : Stop the service"
					 "Restart: Restart the service"
2015-07-20 15:19:03 -07:00
Fabian Homborg
7add4d5782 Normalize *tex completions 2015-07-20 15:19:03 -07:00
Fabian Homborg
f70b1ffbbf Normalize python* completion 2015-07-20 15:19:03 -07:00
Fabian Homborg
8a9b7dc63a Normalize *sum (md5sum et al) completions 2015-07-20 15:19:03 -07:00
Fabian Homborg
3f30096727 Normalize svn completion 2015-07-20 15:19:02 -07:00
Fabian Homborg
52ff997bf0 Normalize atool completions
Remove function, use wrapping.
2015-07-20 15:19:02 -07:00
ridiculousfish
2109af0987 Implement lowercase-r replace in fish_vi_mode
Fixes #1595
2015-07-20 00:29:08 -07:00
Fabian Homborg
b1a0498ff9 Update emacs completion with all options, remove silly mime-hack
__fish_complete_mime used in that way is a no-op on current fish anyway,
and emacs is by no means useful for just text files (it can also view
PDFs, images, ...).

Otherwise this completion currently only offers options, not arguments.

For most these are pretty much incompletable (lisp code, for example),
and for others it's just not all that useful.

Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au>
2015-07-20 09:05:37 +08:00
Fabian Homborg
882f4714ac pacman completion: Turn into regular completion
This used to be a function because we didn't have complete -w

Use that and it becomes a bit simpler.

This also simplifies the code in a few other ways (like removing a
useless-use-of-cat)
and adds comments about a few edgecases.
2015-07-19 18:03:01 -07:00
Fabian Homborg
f359ded336 sysctl completions: Add OSX support 2015-07-19 17:52:25 -07:00
Fabian Homborg
ff4b1104a2 Add sysctl completion
See fish-shell/fish-shell#1375
2015-07-19 17:52:25 -07:00
Fabian Homborg
e35a2450d9 Apropos completion: Ignore stderr
Fixes fish-shell/fish-shell#1171
2015-07-19 17:32:03 -07:00
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
Fabian Homborg
97edc96afd Improve journalctl completion
- Complete fields and (more importantly) values
- Add all options
- Complete boots

Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au>
2015-07-16 16:29:53 +08:00
ridiculousfish
9cf2bb18c2 pngquant delete.png, saving ~1.4 KB 2015-07-12 15:09:24 -07:00
Jonathan Chan
4b8febd44e Add favicon for web config 2015-07-12 15:06:56 -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
Fernando Manfredi
1e32f9431d 👍 New sample prompt from Acidhub
New sample prompt from Acidhub (github.com/acidhub)
This prompt show user|path (full), and a small symbol to
show last command status.

If in a git repository, it's show after the path several
symbols to indicate the branch status and the branch name.

Very handy to me so far.

Signed-off-by: Fernando Manfredi <contact@acidhub.click>
2015-07-12 14:22:18 -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
0f3306870b machinectl: Fix fatal errors in __fish_systemd_has_machine_image 2015-07-02 14:36:48 +08:00
Fabian Homborg
a1b86749cf machinectl completions: Add --no-ask-password 2015-07-02 14:36:48 +08: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
Fabian Homborg
ad237136e7 Add completion for systemd's busctl 2015-06-23 16:02:59 -07:00
ridiculousfish
a4d6a104a6 Correct name and author fields to be lowercase in sorin prompt
fish_config requires that these fields be lowercase, otherwise
they won't show up in the prompt list.
2015-06-23 15:58:56 -07:00
Ivan Tham
a150ae76ac Add sorin theme 2015-06-23 15:46:16 -07: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
ridiculousfish
0ddd0ed4fb fish_config to select the proper tab when run with a tab name
`fish_config abbr` should show "abbreviations" selected
in the tab list.
2015-06-14 00:10:11 -07:00
ridiculousfish
2d1331e104 Tweak the styling of the abbreviation editor
Removes the big white block of the input fields.
2015-06-13 22:56:45 -07:00
ridiculousfish
9223b643b6 Use --remove instead of -e when erasing abbreviations from fish_config
Updates fish_config to use the correct argument to abbr
2015-06-13 22:56:01 -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
013d91d4ee Revert "Add completions for pass"
This reverts commit bfbeca8b6c which was
submitted in #2089.

`pass` ships its own completions and duplication is likely to cause
problems.

See https://github.com/fish-shell/fish-shell/pull/1843 for the
rationale.
2015-05-25 12:02:05 +08:00
John Pham
8e0c1c70ce Add completions for git-filter-branch 2015-05-23 11:43:54 +02:00
Rico Sta. Cruz
bfbeca8b6c Add completions for pass 2015-05-23 06:07:57 +08: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
386d6a77f2 Make fish_config work correctly when IPv6 is disabled in the kernel
Fixes #1754
2015-05-17 19:18:27 -07:00
ridiculousfish
a83323705d Make fish_config work correctly when IPv6 is disabled in the kernel
Fixes #1754
2015-05-17 19:13:50 -07:00
Brendan Whitfield
9b5026f7e5 added cursor:pointer to master_element in web_config css 2015-05-03 17:33:25 +08:00
ridiculousfish
879d03d0fe Reset the color after printing the CWD in classic+git prompt
Fixes #2034
2015-04-23 17:53:40 -07: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
Roman Hargrave
9dc53f7c1b Added completions for apt command 2015-04-16 10:47:36 +08:00
ridiculousfish
6faac2d2c8 Revert "Source files /etc/profile.d/*.fish at startup"
Per discussion in #1956, back this out until we have consensus.

This reverts commit 20a6b65b25.
2015-04-14 10:08:40 -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
Nathan L Smith
34296dd440 add completions for test kitchen 2015-04-07 13:49:54 +08: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
ridiculousfish
e896acffd7 Use $PWD instead of (pwd) in sample prompt
This improves the case where the working directory has vanished

Fixes #1857
2015-03-24 17:03:40 -07:00
ridiculousfish
20a6b65b25 Source files /etc/profile.d/*.fish at startup
Fixes #1956
2015-03-24 16:46:25 -07: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
22103e4849 systemctl: Fix devices/slices/scopes/swaps completion
A rogue single-quote meant that a non-existent function
'__fish_systemctl_$t' was called
2015-03-11 13:29:18 +08:00
Fabian Homborg
5a9b1b1b57 Revert "Adjust filters a bit" - it doesn't work for .service
Unfortunately, list-unit-files doesn't understand --state=loaded

This needs a new function to explicitly use list-units

This reverts commit 9f521b7694.
2015-03-06 23:05:24 -08:00
Fabian Homborg
d99ed89aa3 Adjust filters a bit
This includes only showing unmasked units in mask, only loaded units in
start and more types in show/list-dependencies
2015-03-06 23:05:24 -08:00
Fabian Homborg
b9dd057a04 Make enable/disable completions work again
Was single-quoted, should have been double-quoted
2015-03-06 23:05:24 -08:00
Fabian Homborg
369a09e57e Simplify code by removing duplicated descriptions
For-loops ftw!
2015-03-06 23:05:24 -08:00
Fabian Homborg
468648ff51 systemctl completions: Improve option handling 2015-03-06 23:05:24 -08:00
Fabian Homborg
8c41a053fe systemctl completions: Show options for --property=
Inspired by the official bash completion, this uses systemd --dump-configuration-items.
2015-03-06 23:05:24 -08:00
Fabian Homborg
a1b3358cb8 systemctl completions: Remove duplicated commands 2015-03-06 23:05:24 -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
3d163eb910 systemctl completions: Simplify code by using __fish_seen_subcommand_from 2015-03-06 23:05:24 -08:00
Fabian Homborg
3e32715693 systemctl completions: Support user-mode 2015-03-06 23:05:24 -08:00
Fabian Homborg
388a8d09d8 systemctl completions: Support command-after-options
This fixes completions for e.g. `systemctl --quiet status`
2015-03-06 23:05:24 -08:00
Trenton Broughton
dd595dd110 Added some common completions
* Added completion for `git branch --merged`
* Added completion for `git branch --no-merged`
2015-02-19 11:10:04 -05: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
df6f1e8f62 Add hg branch and status to terlar's prompt 2015-01-30 23:07:40 +08: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
78dfc57b1e web_config: set new prompts via JSON instead of URI-encoded
Fixes problems with encoding and decoding Unicode from URL-encoded strings,
which was impossible to get right in Python 2.
2015-01-30 22:54:13 +08:00
David Adam
d17ba69f9e web_config: respect the client's character set for JSON 2015-01-30 22:52:41 +08:00
David Adam
5c16b5598b web_config: fix python2/3 unification for parse_qs 2015-01-30 22:52:07 +08:00
David Adam
028d9e8e3b default key bindings: ignore FocusIn/FocusOut control sequences
Closes #1917.
2015-01-30 16:01:25 +08:00
David Adam
53a4814d8b web_config: respect linebreaks in prompt demos 2015-01-29 21:41:31 +08:00
David Adam
1ff9aba6b1 rsync completions: rework transformation of file list
Accounts for filenames that contain spaces.

Closes #1872.
2015-01-23 12:27:23 +08:00
Jelte Fennema
f920be5ea3 Make emerge completion more powerful 2015-01-19 17:39:37 +08:00
Jelte Fennema
f9384fe323 Make commands more readable 2015-01-19 17:39: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
volnt
390fe05a87 Update pythonista.fish: make virtualenv aware that prompt is set
Closes #1823, closes #1795.

Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au>
2014-12-28 19:28:12 +08:00
ridiculousfish
8d50b2509d Update completions for fish_indent 2014-12-24 13:07:28 -08:00
Jonathan Arnett
04651105a8 Tmuxinator completions 2014-12-24 02:22:41 -05:00
Max Gonzih
46cd89c2db Support nixos command-not-found handler 2014-12-22 11:16:36 +08:00
Igor Savchuk
381404c4f4 tmux completion: add more attach-session aliases 2014-12-08 17:29:24 +03:00
Konrad Borowski
9a34df604d Make fish_config handle no LANG variable set.
Fixes #1849.
2014-12-05 21:39:21 +01:00
Konrad Borowski
2f96d2b19a Add cygport completions provided by Andrew Schulman
Squashed commit of the following:

commit a396c5e95a9987ea8ce6e057910131886d1b9695
Merge: bfd1951 f329530
Author: Konrad Borowski <x.fix@o2.pl>
Date:   Mon Dec 1 17:54:02 2014 +0100

    Merge branch 'master' of https://github.com/andrex-e-schulman/fish-shell into andrex-e-schulman-master

commit f32953064e
Author: Andrew Schulman <andrex-e-schulman@users.noreply.github.com>
Date:   Mon Dec 1 05:34:29 2014 -0500

    improve descriptions of pkg and diff

commit 81def0fb30
Author: Andrew Schulman <andrex-e-schulman@users.noreply.github.com>
Date:   Mon Dec 1 04:51:20 2014 -0500

    simplify cygport option descriptions

commit 4d84eb3e5c
Author: Andrew Schulman <andrex@5200-glenwood.net>
Date:   Mon Dec 1 04:32:47 2014 -0500

    add command descriptions to share/completions/cygport

commit c7ff7e4fa2
Author: Andrew Schulman <andrex@5200-glenwood.net>
Date:   Mon Dec 1 03:09:00 2014 -0500

    add share/completions/cygport.fish
2014-12-01 17:54:59 +01: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
Vladimir Varankin
019c0fed23 Add completion for git-clean 2014-11-29 00:15:49 +03: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
Misty De Meo
8e8549ef7a brew completion: update completion
* Remove unsupported options
 * Add new 'unpack' command
2014-11-20 08:53:53 +08:00
ridiculousfish
93eea8de66 Filter lines starting with hash from /etc/shells and /etc/group
Fixes the useradd completion when these files
contains comment lines
2014-11-19 11:42:55 -08:00
David Adam
2ddd839f52 Fix error in yum completions
Pass -- to contains.

Closes #1811.
2014-11-17 18:16:11 +08:00
David Adam
9aaf93f364 web_config: improve abbreviations support
* Fetch abbreviations by reading the variable directly.
 * Use space separators for writing new abbreviations.

Work on #731.
2014-11-16 23:20:27 +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
David Adam
a6a41d159c __fish_print_packages: add support for zypper
Closes #1787.
2014-11-13 18:15:35 +08:00
David Adam
00e0ed64bc __fish_systemctl_*: use systemctl to generate the list of units
Closes #1804.

Note that if systemd is not running, the completion will fail.
2014-11-10 12:51:07 +08:00
ridiculousfish
32c0afe5a9 Clean up vared error message output
Fixes #1323
2014-11-09 16:43:14 -08:00
ridiculousfish
43d23ee56e Remove pre-1.22 migration support in fish_config_interactive
This removes some gnarly and probably broken code that attempts
to upgrade from fish 1.21 to fish 1.22. Fixes #1714.
2014-11-09 13:27:56 -08:00
jbbrokaw
9d7fbd2cc0 Fixes typo on line 86 2014-11-04 11:06:21 -08:00
jbbrokaw
32010d1d93 Changes tabs to 4 spaces per fish style 2014-11-04 11:06:21 -08:00
jbbrokaw
75860db511 Adds heroku toolbelt completions 2014-11-04 11:06:20 -08:00
Jared Grubb
d9d9fa512d vi bindings: add CTRL-C handler in default mode
There is no CTRL-C handler for the default mode in the vi bindings. This makes it difficult to say "never mind" and start a new command line like you can do in bash's vi mode. 

There were CTRL-C handlers for insert and visual modes that go back to default mode, but nothing happens in default mode. I copy-pasted the CTRL-C handler from the default key bindings file.
2014-10-31 22:17:17 -07:00
Alex Sulim
d62694a9ce Update completion for Bundler
All commands and options available for Bundler version 1.7.4

Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au> (with trailing
fullstops removed)
2014-10-28 11:58:31 +08:00
Natrim
f03d90e9de Add Composer completion 2014-10-26 22:04:47 +08:00
David Adam
a580d04dbc history: put the output through the pager in interactive mode
(Ideally, the behaviour of git could be implemented: pipe the input
through a pager iff the length is > window size and in interactive
mode).

Closes #1076.
2014-10-26 17:19:29 +08:00
Pawel Zubrycki
c84cdcd00c Added hg repo status to robbyrussell example prompt 2014-10-26 16:00:12 +08:00
David Adam
5638764bad prompt_pwd: Use tilde expansion to get real full home path
Closes #1133.
2014-10-26 14:20:49 +08:00
Roman Inflianskas
cfa41686d2 Add setfacl completions 2014-10-21 08:27:32 +08:00
ridiculousfish
15e095233b Allow funced to retry on error
Fixes #1371
2014-10-17 11:50:09 -07:00
David Adam
a64c372a28 web_config: add support for adding and editing abbreviations
Possible future enhancements include explanatory text and an image for
the 'save' action.

Work on #731.
2014-10-17 10:28:26 +08:00
David Adam
1f91a2a6f5 web_config: map nonexistent post requests to 404 2014-10-17 10:28:26 +08:00
David Adam
4aa38db56f ls: find and use various dircolors initialisation files, if they exist
Closes #1758.
2014-10-17 10:23:05 +08:00
David Adam
4140e678f4 web_config: further python2/3 unification 2014-10-12 16:04:40 +08:00
David Adam
cc0fcdc18d web_config: use only Python 3-style (Unicode) string literals
Improves Python 2/3 compatibility.
(It is the distant future, the year TWO THOUSAND.)
2014-10-12 15:48:14 +08:00
Diego Zamboni
d982f2a575 Vagrant completion updates
Improve vagrant completions for some commands to avoid spurious
completions, and add completions for some missing Vagrant commands.

Fixes #1748.
2014-10-10 15:06:00 -07:00
Kevin Ballard
76c6985f82 A little extra tweaking so builtin_print_help looks better
The terminal width magic that __fish_print_help learned doesn't help
when builtin_print_help runs it in a subshell. Instead, add an
undocumented --tty-width flag to __fish_print_help that's used to pass
the terminal width.
2014-10-10 00:11:23 -07:00
Kevin Ballard
ac8c5910eb Rewrite __fish_print_help to produce better results
As a result of this rewrite, the output now:

* Expands to fit the terminal width, like `man` does
* Preprocesses the manpage with `tbl` just in case, since `man` does
  this, even though I doubt any fish manpages use `tbl` formatting.
* Handle bold/underline with the `ul` command as it was designed for
  instead of trying to fake it with `sed`.
* Compresses blank lines as `man` does with the default `less -is`
  pager.
2014-10-09 23:48:10 -07:00
Kevin Ballard
cc7f1755aa web_config: Interpret fish output as utf-8
Use the unicode replacement character in place of non-utf-8 sequences.
2014-10-09 20:21:26 -07:00
Kevin Ballard
7493c9a040 fish_config: Log the path for errors 2014-10-09 18:33:59 -07:00
Kevin Ballard
9fc8729b96 Support -h/--help with eval
`eval` prints help if given a single argument of -h or --help.

Fixes #1379.
2014-10-09 18:07:57 -07:00
Kevin Ballard
80859b8483 Revert "Remove help completion for eval, which doesn't work"
This reverts commit d2f23e1df4.
2014-10-09 17:59:14 -07:00
David Adam
71c55e1a4a web_config: send correct MIME type (and actually send it) 2014-10-09 18:45:17 +08:00
ridiculousfish
d2f23e1df4 Remove help completion for eval, which doesn't work
Fixes #1379
2014-10-08 11:50:04 -07:00
Kevin Ballard
8e8e63144b Rewrite abbr function
The usage is still the same, but it's a lot more robust, and also no
longer assumes $fish_user_abbreviations must be a universal variable.

This also fixes the unexpected error output when calling `abbr -a` with
no existing abbreviations.

Calling `abbr -a` with an abbreviation that already exists now silently
overwrites the abbreviation, just like `function` and `bind` do, instead
of complaining.
2014-10-07 19:14:44 -07:00
David Adam
3f0210dc96 web_config: fix output if no abbreviations defined 2014-10-07 12:21:02 +08:00
David Adam
7764a1a6f8 web_config: add support for viewing abbreviations
Add a new tab which lists the current abbreviations defined, by wrapping
the `abbr` command.

Work on #731.
2014-10-05 12:23:31 +08:00
David Adam
980bf6e2f4 web_config: set width to dynamic 80% of window
As we add more tabs, 800px looks increasingly cramped, and our config
should take advantage of the screen space available.
2014-10-05 12:23:31 +08:00
David Adam
501c3d5518 abbr.fish: add abbr, a command to manipulate abbreviations
Work on #731.
2014-10-05 12:23:31 +08:00
David Adam
6a0931aeae web_config: update AngularJS to 1.0.8 2014-10-05 12:23:31 +08:00
Konrad Borowski
1665f84d60 Fix Perl module completions.
This fixes the issue with nonexistant directories (some Linux
distributions put these for local modules), and also fixes the
issue of dot meaning any character instead of simply dot.
2014-10-04 11:22:56 +02:00
Roman Inflianskas
fabee7e246 add yast2 completion 2014-10-04 00:41:10 +04:00
Jon Gjengset
0ffa434926 Prevent STDERR leak from abook detection in mutt completion
Fixes #1737
2014-10-03 14:39:42 -04:00
Kevin Ballard
a7727765dc Clean up prompt_pwd with the new function -V flag
Also fixes `cd /private` displaying as no path on OS X.
2014-10-02 18:41:39 -07:00
Kevin Ballard
33a76e1f8e Update psub for the new --inherit-variable flag
Also do some minor formatting cleanup, make psub return 1 when executed
outside of a command substitution, and make it respect $TMPDIR.
2014-10-02 18:41:39 -07:00
Kevin Ballard
3f11d90744 # This is a combination of 2 commits.
# The first commit's message is:

Simplify default fish_prompt

No need for the set_color caching now that it's a builtin.

Also simplify the 3 classic prompts in fish_config's sample_prompts set.
2014-10-02 18:41:01 -07:00
Kevin Ballard
4ba95ad1c3 Minor tweaks to initial keybinding load
Remove comment that AFAICT is not true anymore.

Ensure someone setting __fish_active_key_bindings as a universal
variable doesn't screw up the initial keybinding load.
2014-10-02 12:14:22 -07:00
David Adam
5157ac30fa Create and use $DATADIR/vendor_completions.d/ for upstream completions
Closes #1485.
2014-10-01 21:28:01 +08:00
David Adam
a186f04f15 Manpage completions: store in $XDG_DATA_HOME
Closes #1343, works towards #1257.
2014-09-29 19:39:36 +08:00
Vincent Huang
15ca3b426f Added some completions for opam
All opam subcommands and descriptions are covered, along with
all the flags that are common to all commands. However, only
`opam config` has complete subsubcommand coverage.
2014-09-29 14:34:07 +08:00
David Adam
1c9aec4899 bind: add completions for -m and -M
See https://github.com/fish-shell/fish-shell/issues/1663
2014-09-29 14:22:37 +08:00
David Adam
f0d8d90ed1 __fish_print_hostnames: use awk to process ssh_config files
Uses awk rather than sed to account for multiple formatting options.

Closes #1260.
2014-09-29 14:08:09 +08:00
David Adam
6ece8523b1 __fish_complete_path: add new completion, mimics builtin path completion
Completions can now be written which disable file completion and then
selectively re-enable it using this function.

Closes #834.
2014-09-29 14:05:18 +08:00
Konrad Borowski
26051ea198 Add Meta+H as keybinding for man page.
Apparently, in zsh, Meta+H can be used to display the manpage for
the current command. This commit adds this zsh feature to fish shell.

The F1 keybinding is left, although it's now secondary according to
fish help, as some terminal emulators don't let the user press F1 key.
2014-09-28 11:12:25 +02:00
David Adam
3ac28f2b01 Revert "math.fish: support floating-point maths"
This reverts commit 7cad0069e8.

https://github.com/fish-shell/fish-shell/issues/1723
http://superuser.com/questions/31445/gnu-bc-modulo-with-scale-other-than-0

This is why we can't have nice things.
2014-09-27 23:27:05 +08:00
David Adam
7cad0069e8 math.fish: support floating-point maths
Closes #1643.

Thanks to Mickaël RAYBAUD-ROIG (https://github.com/m-r-r) for the idea
of printf.
2014-09-27 18:38:44 +08:00
lledey
73158d6255 Fix emacs completion on OS X
Avoid calling seq with 0 as argument since its behaviour is wrong on OS X.
2014-09-24 13:05:22 +01:00
Konrad Borowski
8d03baa4e0 Make fish config work if one of colors is undefined.
This moves the sorting to be done before sorting remaining colors.
2014-09-23 13:48:00 +02:00
Kevin Ballard
e1f623f548 Only print fish_greeting for interactive shells
Shell scripts that use `read` should not trigger fish_greeting.

Fixes #1401.
2014-09-21 20:35:33 -07:00
Kevin Ballard
a9c8b75599 Tweak git completion for aliases/stashes
Use the new `read -z` flag to complete git aliases better. This approach
won't break if an alias contains a newline.

Also fix stash completion, which was broken on BSD sed.
2014-09-21 19:54:42 -07:00
Konrad Borowski
166a2f91bd Use double dashes for contains in fossil completions.
This fixes the issue with strange behaviour of fish shell when first
option of a command is an option.
2014-09-21 14:32:37 +02:00
Kevin Ballard
a381ac2691 Complete custom git commands in $PATH
Git treats executables in $PATH that start with "git-" as custom
subcommands. Add completion support for them.

Fixes #1680.
2014-09-19 19:19:59 -07:00
Kevin Ballard
e2be71cbe4 Better git alias completion
Config entries that contained the word "alias" but were not in fact
aliases no longer are treated as aliases.
2014-09-19 19:19:59 -07:00
ridiculousfish
6083c6fc72 Incorporate attribute links for color themes in web_config 2014-09-19 18:44:50 -07:00
Kevin Ballard
0a32d96b27 Reset fish_bind_mode when changing fish_key_bindings
Also avoid resetting bindings if fish_key_bindings is "modified" without
actually changing.

Fixes #1638.
2014-09-18 15:46:17 -07:00
David Adam
eb40baacfc update completions for builtin commands 2014-09-17 10:17:48 +08:00
Michael Stillwell
133ba6e01b Ignore "host", "hostname", and hostname wildcards
See the PATTERNS section of ssh_config(5) for wildcards supported by ssh.
2014-09-16 17:20:59 +02:00
qjcg
9bfb4f1e11 Fix webconfig URL generation for python3
Closes #1677.

Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au>
2014-09-15 16:40:28 +08:00
Kevin Ballard
f22864b813 Ensure type still works if $IFS is unset 2014-09-08 23:35:29 -07:00
Kevin Ballard
15cf06438e Suppress PATH errors in sudo tab-completion
Setting a non-existant path component to PATH logs an error to stderr.
This is not appropriate for non-interactive temporary modifications,
like the one done by the `sudo` completion helper function.
2014-09-04 13:22:06 -07:00
Konrad Borowski
1d0279eac5 Fix F1 binding to work with multiple tokens. 2014-08-30 11:18:56 +02:00
Nikolai Aleksandrovich Pavlov
cb29350954 Fix fish_vi_mode.fish 2014-08-29 13:15:13 -07:00
Konrad Borowski
71ab40e536 Add Fossil command completions. 2014-08-29 14:19:55 +02:00
ridiculousfish
f9f773cc28 Comment on why we run 'false' in web_config.py 2014-08-22 12:04:23 -07:00
Kevin Ballard
d9bf53c6e5 Show a non-zero status in the fish_config prompt
When selecting a prompt with fish_config, render the prompt with a
non-zero status so the user knows what it looks like.
2014-08-22 12:00:16 -07:00
Kevin Ballard
f549ada16c Set up fish_{function,complete}_path properly
In the base config.fish, fish_function_path and fish_complete_path have
$__fish_datadir/{functions,completions} added to them if not already
present. For some reason they were replacing the final path component
instead of being added on to the end.
2014-08-22 11:54:58 -07:00
Kevin Ballard
61ce9db4ba Make the alias built-in function work better
The new --wraps functionality was breaking aliases of the form
`alias foo='bar baz'`. That is, aliases where the body is multiple
words. Extract the first word of the body and use that instead.

Use better errors for aliases with no name or no body.
2014-08-22 11:40:59 -07:00
ridiculousfish
2da435712a Merge branch 'master' of github.com:fish-shell/fish-shell 2014-08-22 11:39:41 -07:00
Andy Lutomirski
9079ec459c webconfig: fixes for token security
* Use 16-byte tokens
 * Use os.urandom (random.getrandbits shouldn't be used for security)
 * Convert to hex correctly
2014-08-22 15:44:43 +08:00
Andy Lutomirski
aaddccfdb1 webconfig: Use a constant-time token comparison
This prevents a linear-time attack to recover the auth token.
2014-08-22 15:39:13 +08:00
ridiculousfish
033373f078 Merge branch 'make_type_better' of github.com:kballard/fish-shell into kballard-make_type_better 2014-08-21 21:36:39 -07:00
ridiculousfish
06400b83b1 Support for command wrapping ("aliases")
Add the --wraps option to 'complete' and 'function'. This allows a
command to (recursively) inherit the completions of a wrapped command.
Fixes #393.

When evaluating a completion, we inspect the entire "wrap chain" for a
command, i.e. we follow the sequence of wrapping until we either hit a
loop (which we silently ignore) or the end of the chain. We then
evaluate completions as if the wrapping command were substituted with
the wrapped command. Currently this only works for commands, i.e.
'complete --command gco --wraps git\ checkout' won't work (that would
seem to encroaching on abbreviations anyways). It might be useful to
show an error message for that case.

The commandline builtin reflects the commandline with the wrapped
command substituted in, so e.g. git completions (which inspect the
command line) will just work. This sort of command line munging is
also performed by 'complete -C' so it's not totally without precedent.

'alias will also now mark its generated function as wrapping the
'target.
2014-08-15 18:14:36 -07:00
ridiculousfish
fe68d30be9 Use sgrep instead of grep in ssh completion 2014-08-13 01:06:15 -07:00
ridiculousfish
a3a11c2e0c Strip users with leading underscores from ssh completions 2014-08-12 14:46:59 -07:00
ridiculousfish
3f526698ab Make __fish_print_users work on OS X via dscl 2014-08-12 14:42:49 -07:00
David Adam
4ae2753025 Authenticate connections to web_config service
- Require all requests to use a session path.
 - Use a redirect file to avoid exposing the '/start' URL on the
   command line, as it contains the cookie value.

Fix for CVE-2014-2914.
Closes #1438.
2014-08-04 13:34:26 +08:00
Kevin Stone
556680cf5e Update grunt.fish
Fixed command error when no local Gruntfile results in a command error.

Fixes #1592.
2014-08-02 00:04:26 -07:00
Konrad Borowski
6c80a3461c
Add support for toor account.
Currently fish doesn't recognize toor as special. However, it's likely
that on BSD systems, fish shell will be used on toor, not on root (toor
is an intentionally existing account to use more advanced shell on, like
shell).
2014-07-30 11:55:47 +02:00
phette23
5591afff6e add completions for Node.js & NPM 2014-07-29 18:35:08 -07:00
ridiculousfish
b6658c5497 Render sample prompts faster in fish_config by using a thread pool 2014-07-29 12:12:32 -07:00
ridiculousfish
aad5163b49 Make prompt selection more like color selection in fish_config. Remove
the "show prompt source" button.
2014-07-29 11:00:39 -07:00
David Xia
6d18bf5cd4 Fix umask function regex
Some grep implementations complain of empty subexpression

fixes #1313
2014-07-29 01:43:18 -04:00
David Xia
adabc2d7a0 Fix fish_config error with python3
Closes #1253.
2014-07-28 22:02:55 +08:00
Siteshwar Vashisht
317660c2fe Avoid using OptionParser to parse bindings in webconfig.py
OptionParser eats commaandline arguments passed to bind actions, so avoid using it.
2014-07-25 08:39:31 +05:30
ridiculousfish
f6a89d13c2 Merge branch 'master' of github.com:fish-shell/fish-shell 2014-07-23 22:27:37 -07:00
Siteshwar Vashisht
3e01dd955f Updated code to parse bindings in webconfig.py 2014-07-23 01:53:15 +05:30
adisbladis
27fa0ea9d7 "webconfig.py: Don't allow NoneType as buffer, fallback to bytes.
Fixes TypeErrors when using bindings tab"
2014-07-22 12:31:57 +02:00
Michishige Kaito
2de914d8c3 Select the 4th line of output, instead of the second to last line 2014-07-16 18:22:27 +01:00
Michishige Kaito
616fa85458 Add grunt completion 2014-07-16 16:53:18 +01:00
Kevin Ballard
16e50c258a type: Restore combined flags behavior
Fix the parsing of `type` flags to handle combined short flags as
appropriate, e.g. `type -qf ls`.
2014-07-14 11:27:11 -07:00
Kevin Ballard
72e8489d50 command: Rename -p/--path flag to -s/--search 2014-07-13 19:11:29 -07:00
Kevin Ballard
29b3b6b31e type: Stop claiming grep is a function
Use `functions -q` instead of searching the `functiosn -na` list for the
provided word. This may result in an automatically-loaded function being
sourced, but that happens anyway with the default output.

This change means the results of `test -q foo` can be relied upon to
indicate whether `foo` can actually be invoked. Previosly, if `foo` was
the name of an automatically-loaded function file but did not actually
define a function `foo`, and there was no execuable `foo`, then `type -q
foo` would lie and say `foo` can be invoked when it can't.
2014-07-13 19:11:29 -07:00
Kevin Ballard
533496e43a Adopt the new type -q flag in the other functions 2014-07-13 19:11:29 -07:00
Kevin Ballard
6f7a7459c1 test: Add a new --quiet flag to suppress output
The --quiet flag is useful when only the exit status matters.

Fix the documentation for the -t flag to no longer claim that `type` can
print "keyword", as it never does that.

Stop printing a blank line for functions/builtins when the -p flag has
been passed. It's just not useful.
2014-07-13 19:11:29 -07:00
Kevin Ballard
6b062b07b4 type: Separate the notion of multi and paths
Track whether -a and -f have been supplied separately. That way both
`type -a -f command` and `type -f -a command` behaves correctly, as does
`type -a -f foo` where there are multiple executables named `foo` in the
$PATH.
2014-07-13 19:11:29 -07:00
Kevin Ballard
bfd3a47380 Fix type function to work better
Stop using getopt to parse flags. It's far more expensive than
necessary, and results in long flags not being parsed on OS X. This also
allows args starting with - after the options list to be properly
interpreted as a value to test.

Print the error message to stderr as is appropriate.

Use the new `command -p` functionality when the -a flag has not been
provided (`command` does not have any equivalent to the -a flag),
instead of using `which`. This is faster and also avoids any possible
disagreement between `which` and what fish thinks is valid.

Stop testing every path to see if it's executable, that test has already
been done by `which` or `command -p`.

The end result is `type -P ls` is roughly 250% faster, according to
profiling, on my OS X machine.
2014-07-13 19:11:29 -07:00
Maxim Gonchar
3acd0dfe48 Add dropbox completion 2014-07-06 20:40:53 +08:00
Sascha
ed5e585684 Also add forward/backward movement in insert mode 2014-06-27 22:55:27 +08:00
Sascha
32948b8dc6 Provide more useful insert mode mappings 2014-06-27 22:55:20 +08:00
Cameron Norman
ad5ad3d1ad Fix bug for systemd being installed but not PID 1 2014-06-20 11:08:35 +08:00
Siteshwar Vashisht
7b3132d39d Fixed code to parse bindings for webconfig 2014-06-08 16:05:00 +05:30
Konrad Borowski
d97e31b4ab git prompt shouldn't export variables. 2014-06-01 09:39:28 +02:00
David Adam
3225d7e169 avoid symlink attacks in __fish_print_packages and spawning fishd
* use $XDG_CACHE_HOME for __fish_print_packages completion caches
 * when starting fishd, redirect fishd output to /dev/null, not a
   predictable path

Fix for CVE-2014-3219.

Closes #1440.
2014-05-12 09:30:05 +08:00
Josh Kuhn
cbef88a593 Fix python completion to work for pypy
Pypy outputs 2 lines with the -V option, as well as adding a whole lot of stuff that confuses the very general sed regex that was used before.
2014-05-03 15:06:57 -07:00
SanskritFritz
b13179d4f4 Functions instead of static variables for conditions. 2014-05-03 12:30:41 -07:00
SanskritFritz
cf89d9bfb0 Fixed an unintended result of some copy paste. 2014-05-03 12:30:41 -07:00
SanskritFritz
f49848c8a4 Removed unnecessary comments. 2014-05-03 12:30:41 -07:00
SanskritFritz
0101b39f6c Completions added/updated. 2014-05-03 12:30:41 -07:00
Maurizio De Santis
4285baa6e1 Prompt sample: Debian chroot environment
When you chroot in Debian, bash shows the chroot environment in the prompt:

```bash

...

if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

...
```

This is the effect:

```
(chroot_env) user@host:~#
```

It is useful when chrooting, since usually the hostname remains the same and thus you can't distinguish where you are.
2014-05-03 12:28:38 -07:00
David Adam
55bc4168bf use mktemp(1) to generate temporary file names
Fix for CVE-2014-2906.

Closes a race condition in funced which would allow execution of
arbitrary code; closes a race condition in psub which would allow
alternation of the data stream.

Note that `psub -f` does not work (#1040); a fix should be committed
separately for ease of maintenance.

Closes #1437
2014-04-28 10:42:00 +08:00
David Flores
2bbb59964f functions on top 2014-04-19 14:50:15 -07:00
David Flores
4fd32eb48e added docker completion file 2014-04-19 14:50:15 -07:00
Maxim Gonchar
2872a98b2b Set fish_vi_key_bindings to start in insert mode by default
Add optional argument for fish_vi_key_bindings to set desired initial
mode:
> fish_vi_key_bindings default
2014-04-19 14:48:15 -07:00
Fabian Ruff
f2a507c4a7 fix gem --version/--help tab completions 2014-04-06 12:58:22 -07:00
Steven Allen
17ab7bde44 Bind 0 to beginning-of-line in vi mode. 2014-04-06 12:49:52 -07:00
Steven Allen
fcc363333c Move cursor back on insert mode exit.
Make this consistent with vi.
2014-04-06 12:46:14 -07:00
Daniel Matz
2f6551b3b1 Properly detect when MQ is enabled for Mercurial completion. 2014-03-31 10:08:10 -07:00
Daniel Matz
50ae14cf7b Properly complete Mercurial bookmarks when only one bookmark exists.
The if statement checking the output of hg bookmarks uses two conditions
joined by the or keyword.  However, only the first part was being used.
Wrapping the two statements with begin and end properly combines them.
2014-03-31 10:08:10 -07:00
Daniel Matz
79b7cd69bb Add fallback for label completion in older versions of Mercurial. 2014-03-31 10:08:10 -07:00
Daniel Matz
cf237a0e4f Replace use of xargs with command substitution in Mercurial completion. 2014-03-31 10:08:10 -07:00
Daniel Matz
c0d147c5c4 Add the __fish prefix to all Mercurial completion functions. 2014-03-31 10:08:10 -07:00
Daniel Matz
bd707b4a96 Remove unnecessary use of uniq in Mercurial completion.
Fish already takes care of duplicate completions.
2014-03-31 10:08:10 -07:00
Daniel Matz
daaed863da Use the current commandline token for Mercurial filename completion.
The token variable was being used, but I must have accidentally deleted its
definition while I was working on the original version of the file.
2014-03-31 10:08:10 -07:00
Daniel Matz
2bdfac2036 Use local scope for variables in Mercurial completion functions. 2014-03-31 10:08:10 -07:00
Daniel Matz
d74a23e583 Improve Mercurial command completion.
Rewrote the completion file by hand.  Added completion of files, bookmarks,
revision labels, etc.
2014-03-31 10:08:09 -07:00
Anders Bergh
44b35f7735 fish_config: Listen on both IPv6 and IPv4.
A subclass of TCPServer was created to deny any non-local connections and to
listen using an IPv6 socket.
2014-03-31 10:06:46 -07:00
Kevin Ballard
fe3b439e31 Fix non-verbose, non-informative __fish_git_prompt
At some point the non-verbose, non-informative variant of the prompt
(e.g. the variant that looks like the bash prompt) was modified to try
and show the behind/ahead counts the same way the informative prompt
does. Besides being wrong, it also didn't work because behind/ahead
weren't defined.
2014-03-31 09:59:41 -07:00
Lukas Stabe
6c987d6708 add pacsrv completion 2014-03-31 09:54:28 -07:00
ridiculousfish
28fd1a4c5d Merge branch 'master' of github.com:fish-shell/fish-shell 2014-03-30 21:58:32 -07:00
ridiculousfish
d4fafeb6d6 Merge branch 'master' into 1218_rebase
Conflicts:
	builtin.cpp
	builtin_commandline.cpp
	highlight.cpp
	input.cpp
	input.h
	reader.cpp
	screen.cpp
	screen.h
2014-03-29 14:19:45 -07:00
Knut Ahlers
1270384ede Fixed appearance of ssh hostnames with [] in them
refs https://github.com/fish-shell/fish-shell/issues/1355
2014-03-29 11:46:45 +01:00
Konrad Borowski
1486774249 Force at least one line of output for set_color.
This should fix #1323.
2014-03-03 22:17:55 +01:00
ridiculousfish
be33d3f2a4 Revert "Merge pull request #1317 from pullreq/cpp"
This reverts commit 74135c0600, reversing
changes made to 6d749789ce.

See discussion in #1317
2014-02-28 02:16:48 -08:00
Geoff Nixon
18dd6f58e3 Fixes .c -> .cpp in comments. For doxygen. 2014-02-27 06:23:40 -08:00
Konrad Borowski
6d749789ce Use 127.0.0.1 for fish config.
Before this change, fish config used 0 as its address. However, this
isn't a good idea from security point of view, as web service can be
accessed from everywhere, and do anything on the account it was ran on.

This also deals with firewalls which block the access to 0 even from
the host machine itself. It possibly might fix #673, but I'm not sure.
2014-02-27 14:47:08 +01:00
ridiculousfish
5e7c01c251 Rework color editing in fish_config. Bury customization mode a bit:
initially the user only sees the various themes, and has to activate
customization mode to change colors. Tweak the appearance as well.
2014-02-24 01:56:02 -08:00
ridiculousfish
3ab954644f Make fish install a command_not_found handler in non-interactive uses.
Previously, fish's command_not_found handler would be installed in
__fish_config_interactive. Errors that occured early in startup (e.g. in
config.fish) or in non-interactive mode would therefore not be reported.
With this change, fish now exposes its default cnf handler as
__fish_default_command_not_found_handler . config.fish then installs a
cnfh that invokes the default. When fish goes interactive, the initial
cnfh is overwritten with a fancier one, that may in turn fall back to
invoking the default.
2014-02-20 10:26:57 -08:00
Mandeep Sandhu
ef9f2ab31f Add completions for git stash sub-commands
Closes #1102.

Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au>
2014-02-16 21:58:21 +08:00
Eric Mrak
64ca6c066c Caching for pacman packages. 2014-02-16 18:09:55 +08:00
Eric Mrak
d1cf5ab286 adding completion for aura. adding pacman integration for __fish_print_packages 2014-02-16 18:09:55 +08:00
waterhouse
b1545c5ce2 'seq' should return 1, not exit 1, on bad arglist 2014-02-16 01:17:12 -08:00
ridiculousfish
77dbaf3aef Fix for Python out-of-range exception when accessing Bindings tab 2014-02-09 20:19:04 -08:00
glennj
b475325b5e math.fish: exit if no output (e.g. from syntax error)
Closes #1175
2014-02-05 17:26:34 +08:00
ridiculousfish
7d345018af Redirect stderr of initial call to __fish_reload_key_bindings. Fixes ##1155 2014-02-03 16:46:01 -08:00
David Adam
27b6fe682d Squashed commit of the following:
commit d81ae2665f
Author: Max Gonzih <gonzih@gmail.com>
Date:   Sun Feb 2 16:22:18 2014 +0300

    Check for command-not-found command on suse

commit 004b794c82
Author: Max Gonzih <gonzih@gmail.com>
Date:   Sun Feb 2 14:04:41 2014 +0300

    Fix cnf handler for Suse and Fedora

    fixes #1208
2014-02-02 21:42:24 +08:00
Siteshwar Vashisht
a1b43b7a09 Fix for opening bindings tab as initial tab
'fish_config bindings' command should open bindings tab as initially active tab
2014-01-30 23:53:49 +05:30
ridiculousfish
20130d89dc Support for escaped colons in makefile targets in __fish_print_make_targets, as part of #1259 2014-01-29 15:42:52 -08:00
David Adam
8490aac025 sshfs completions: use all directories as mount points
Closes #1268.
2014-01-29 13:33:27 +08:00
David Adam
8fbffe250a __fish_print_packages: correct syntax for yum, improve yum/rpm pipelines
Closes #1269 (output to cache file).

Reworks the editing pipeline for both yum and rpm completions down to a
single sed command.
2014-01-29 12:47:56 +08:00
Geoff Nixon
60808a4820 Enhance/fix isatty using command test.
Presently, `isatty` only works on a handful of keywords. Here it
  is rewritten to be able to take any path, device or fd number as
  an argument, and eliminates errors printed to stdout.
  Per discussion in #1228, using `builtin test -c` within a pipe to
  test special file descriptors is not viable, so this implementation
  specifcially uses `command test`. Additionally, a note has been
  added to the documentation of `test` regarding this potential
  aberration from the expected output of the test utility under the
  'Standards' section.
2014-01-28 11:14:54 -08:00
ridiculousfish
7d8766980b Support escape or up-arrow to cancel the completion search field. 2014-01-27 02:17:31 -08:00
ridiculousfish
5be3606236 Increased support for completion search field. Use btab (shift-tab) to
complete-and-search.
2014-01-27 00:56:13 -08:00
ridiculousfish
6d13b8bbc0 Teach down-or-search how to use down-arrow to begin pager navigation 2014-01-25 15:32:13 -08:00
ridiculousfish
2139334c36 Fix for issue where wc on OS X would produce leading spaces, causing
down-or-search to fail to match the case statement and therefore do the wrong thing.
2014-01-25 15:22:28 -08:00
Julian Aron Prenner
844b01cb6b Add 'and' input function; fixes a bug with t,T
'and' will prevent later input functions from being executed if the
previous one did not succeed (e.g. a jump to a char not on the command
line)
2014-01-23 10:23:04 +01:00
Julian Aron Prenner
45465e0c45 Merge branch 'bind_mode' of github.com:furunkel/fish-shell into bind_mode 2014-01-22 10:01:53 +01:00
Julian Aron Prenner
4a9be7bf11 Experimental support for f,F,t,T vi commands.
Input functions can now have arguments
2014-01-22 10:00:44 +01:00
Julian Aron Prenner
c8e0d18d18 Change mode colors in prompt 2014-01-22 09:00:57 +01:00
Maxim Gonchar
f284f00935 Add tmux support 2014-01-20 21:28:54 +04:00
Maxim Gonchar
71992158bf Retab again
default_keybindings are left with tabs as it was in the beginning
2014-01-20 17:12:32 +04:00
Maxim Gonchar
1514ab8ec5 Retab 2014-01-20 17:03:46 +04:00
Maxim Gonchar
3591900070 More clear way of setting cursor shape 2014-01-20 16:47:13 +04:00
Julian Aron Prenner
44c6fa68cf Make Ctrl-x autocomplete suggestions; cosmetics 2014-01-20 13:07:32 +01:00
Maxim Gonchar
1279888567 Add cursor shape handler 2014-01-20 10:19:41 +04:00
Max Gonzih
114f803a88 Fix e and E in visual vi mode 2014-01-19 17:07:23 +03:00
Max Gonzih
69778efb6b Add x binding to delete whole line in visual mode 2014-01-19 17:04:02 +03:00
Max Gonzih
e7df20f69b Add x binding to delete selection in visual vi mode 2014-01-19 16:50:56 +03:00
Julian Aron Prenner
cd64a777c3 Set $fish_bind_mode to default on fish startup; set $fish_key_bindings
when sourcing fish_vi_mode.fish
2014-01-19 10:27:39 +01:00
ridiculousfish
808bc42f2a Further work on keyboard navigating the completion list 2014-01-18 12:42:53 -08:00
Julian Aron Prenner
3728fc7dba Add kill-selection function and visual binds for 'y' and 'd' 2014-01-18 10:18:29 +01:00
Julian Aron Prenner
88eae68987 Fix a bug, commandline -s works now as expected. Add "*y binding in
visual mode
2014-01-17 20:32:24 +01:00
furunkel
8b89bd7a1f Merge pull request #4 from maxfl/bind_mode
Minor bind fixes
2014-01-17 08:06:49 -08:00
Maxim Gonchar
fc68b9d7cd Minor bind fixes
Comment out 'o' binding
Add '['/']' bindings to navigate current token history
Fix 'P' to paste indeed
Add "*P/"*p to insert current selection clipboard using xsel
2014-01-17 10:40:32 +04:00
Julian Aron Prenner
0cd125b55c Merge branch 'bind_mode' of github.com:furunkel/fish-shell into bind_mode 2014-01-15 22:41:50 +01:00
Julian Aron Prenner
444cb894be Set selection color to purple 2014-01-15 22:41:10 +01:00
Maxim Gonchar
8138b2080b Even dirtier *aw/*iw 2014-01-16 01:25:44 +08:00
Maxim Gonchar
737b204b2c Add dirty bindings for *iw, *aw
Put E, W bindings in agreement with vim
2014-01-16 00:55:51 +08:00
Julian Aron Prenner
213e907044 Merge remote-tracking branch 'upstream/master' into bind_mode
Conflicts:
	builtin.cpp
	reader.cpp
	share/functions/fish_default_key_bindings.fish
2014-01-15 15:27:06 +01:00
Julian Aron Prenner
c8d5131a42 Add experimental support for selection and visual mode 2014-01-15 15:07:22 +01:00
Julian Aron Prenner
fc21bb6eda Replace builtin 'bind_mode' with variable $fish_bind_mode 2014-01-15 12:04:52 +01:00
Maxim Gonchar
9684cbf850 Add optional options to fish_default_key_bindings
These options will be passed to the bind command.
Now it's possible to call
  fish_default_key_bindings -M insert
to set all original bindings to the insert mode
2014-01-15 15:26:38 +08:00
Maxim Gonchar
b0e94c15e6 Update vi bindings:
The following normal mode bindings are added:
    o, I, A, gg, G, g^, g$, x, X, backspace, d*, D, s, S, c*, C, ~, gu,
    gU, J, K, y*, Y, p, P

I was not able to add binding for 'O'

dd now deletes the whole line as vim, while D deletes the line to the
end. c, s, y act the same way
2014-01-15 00:21:13 +08:00
Julian Aron Prenner
874d3aca45 Make Ctrl+C exit insert mode, add some more backspace binds. 2014-01-14 15:24:26 +01:00
Konrad Borowski
b9394b9599 Rename __fish_complete_usb function. 2014-01-14 08:28:15 +01:00
leafonsword
129d2f803a 新文件: share/completions/lsusb.fish
新文件:    share/functions/__fish_complete_usb.fish
2014-01-13 20:24:20 +01:00
Max Gonzih
71f6986dd6 Fix __fish_print_packages for rpm 2014-01-13 22:36:02 +08:00
Alexander I.Grafov
75b02e1d27 Fixes issue #1234. Fish now parses system wide ssh configuration file in addition to user config. 2014-01-12 14:59:46 +05:30
Konrad Borowski
2927514e68 Partially fix #1224.
It would be nice if this would work without this hack,
but until then, this has to work. Requires you to reinstall
the prompt using fish configuration system.
2014-01-10 21:33:50 +01:00
David Adam
02bd933c58 Add Alt+. as a default binding for history-token-search-backward
Closes #89.
2014-01-08 15:15:15 +08:00