Commit graph

4646 commits

Author SHA1 Message Date
ridiculousfish
781bbe217a 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:13:33 -07:00
ridiculousfish
064ad7b981 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:20 -07:00
ridiculousfish
6fbb3c9976 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:12:23 -07:00
ridiculousfish
7b34aaa432 Tweak the styling of the abbreviation editor
Removes the big white block of the input fields.
2015-06-14 00:12:23 -07:00
ridiculousfish
5c6143d8e9 Use --remove instead of -e when erasing abbreviations from fish_config
Updates fish_config to use the correct argument to abbr
2015-06-14 00:12:23 -07:00
ridiculousfish
ea407476d0 Correctly un-export an env var when it is shadowed
Prior to this fix, if you exported a variable in one scope
and then unexported it in the next, it would remain exported.
Example:

    set -gx VAR 1
    function foo; set -l VAR; env; end
    foo

Here 'VAR' would be exported to 'env' because we failed to
notice that the env var is shadowed by an unexported variable.
This occurred at env var computation time, not in env_set!

Fixes #2132
2015-06-12 16:11:45 -07:00
David Adam
b6b6de3304 vi bindings: clear commandline with Ctrl-C
Closes #2077.
2015-06-05 14:01:43 +08:00
ridiculousfish
79a6961793 Add some simple documentation for fish_vi_mode 2015-06-04 13:18:17 -07:00
ridiculousfish
6c53862ff1 Suppress uvar error messages due to permissions or file not found
su does not reset XDG_RUNTIME_DIR, which means that XDG_RUNTIME_DIR
may point to directories that the user does not have permission
to access. Similarly there is no guarantee that XDG_RUNTIME_DIR
points to a directory that actually exists. Rather than try to
handle these issues, we simply ignore them, effectively disabling
realtime uvar notifications. Fixes #1955.
2015-06-01 23:03:11 -07: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
edf6a951ee Unescape the token returned by builtin_commandline
Fixes #2075
2015-05-22 08:46:23 +08:00
David Adam
1c99ef5b6e FAQ: shorter fish_title fix
[skip ci]
2015-05-21 12:05:21 +08: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
ridiculousfish
49b49d7ed4 Pass the character index, not the character, to parse_util_expand_variable_error
Fixes #2067
2015-05-15 17:17:30 -07:00
David Adam
14bf2ee5cb bump version for 2.21b 2015-05-05 08:37:06 +08:00
Jakukyo Friel
cec1dc2095 doc: faq: avoid overwriting config.fish.
In FAQ:

> I'm seeing weird output before each prompt when using screen. What's wrong?

The command provided is

    echo 'function fish_title;end' > ~/.config/fish/config.fish

Using `>` will overwrite current config.fish.

We should use `>>` instead.
2015-05-03 23:38:05 -07:00
Brendan Whitfield
9b5026f7e5 added cursor:pointer to master_element in web_config css 2015-05-03 17:33:25 +08:00
ridiculousfish
96dfd27725 Disable __fish_parse for 2.2 release
Fixes #1809
2015-05-02 21:35:49 -07:00
ridiculousfish
905d8b2aa5 Don't stop history search on repaint
Fixes #2044
2015-05-02 18:42:38 -07:00
ridiculousfish
3ca518255e Treat comments ending in backslashes as not continuing onto the next line
Fixes #1255
2015-05-02 18:22:20 -07:00
ridiculousfish
c59119e0b7 Correct a reference to the wrong issue. 613, not 163! 2015-05-02 17:54:32 -07:00
ridiculousfish
0748a4d8b6 Use a more appropriate type for the reader_test function 2015-05-02 17:49:38 -07:00
ridiculousfish
3722f91e38 Upgrade Xcode project format to latest 2015-05-02 17:12:34 -07:00
ridiculousfish
ba721d6cbf Teach Xcode build to create vendor_completions.d directory
Per #1485
2015-05-02 16:58:47 -07:00
David Adam
5532e5aa8a docs: document pkg-config command for vendor_completions.d 2015-05-01 16:56:21 +08:00
David Adam
9cae8bf8a6 docs: document __fish_complete_path function
Introduced with 6ece852 for #834.
2015-05-01 16:56:21 +08:00
David Adam
cb92a1d12f CHANGELOG: remove, unused
[skip ci]
2015-05-01 16:56:17 +08:00
ridiculousfish
1242e63b6a Use mode 0600 for history file
Fixes #2041
2015-04-29 17:52:50 -07:00
ridiculousfish
f30872a7b5 Recalculate exported variables when universal variable is erased
Fixes #2046
2015-04-29 17:28:49 -07:00
ridiculousfish
9c3a9a1e73 Remove a redundant implementation of append_syntax_error 2015-04-29 17:02:32 -07:00
ridiculousfish
c91f70523c Rework error messages to be shorter and to handle more special bash-isms
Example: we can point $* to argv

Fixes #1288
2015-04-29 16:53:02 -07:00
ridiculousfish
3d9c24196d Add test for error messages
Preparation for issue #1228
2015-04-25 18:47:17 -07:00
Ingo Blechschmidt
6f438f65de typo 2015-04-25 18:59:43 +02: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
ridiculousfish
c3ef23b10f Support for a "pending item" in history.
Before running a command, we add the command to history, so
that if the command causes us to exit it's still captured in
history. But that command should not be considered part of
history when expanding the history within the command itself.
For example, `echo $history[1]` should be the previously
run command, not `echo $history[1]` itself.

Fixes #2028
2015-04-20 02:04:17 -07:00
Sanne Wouda
722fedc8fd rewrite input_mapping_execute for clarity
For the case
```
bind \et "commandline -i 1" "commandline -i 2"
```
the order of execution of the commands is now in-order.

Note that functions codes are prepended to the queue in reverse order, so they
will be executed in-order.  This should allow all bindings of the form
```
bind \et beginning-of-line force-repaint
```
to remain unchanged.
2015-04-19 16:56:48 -07:00
Sanne Wouda
32936b0eb9 Change lookahead_list into a queue
Using builtin `commandline -f`, one would expect to have commands executed in
the order that they were given.  This motivates the change to a queue.

Unfortunately, fish internals still need lookahead_list to act as a stack.  Add
and rename functions to support both cases and have lookahead_list as
a std::deque internally.

This code is delicate, and we should probably dog-food this in nightly for
a while before the next-minor release.

Fixes #1567
2015-04-19 16:56:48 -07:00
Roman Hargrave
3559f20c8f Pass entire argv content to fish_command_not_found recipients 2015-04-19 15:50:10 -07:00
Roman Hargrave
9dc53f7c1b Added completions for apt command 2015-04-16 10:47:36 +08:00
Konrad Borowski
9c007d1c94 Revert "document evaluation of /etc/profile.d/*.fish, introduced in 20a6b65"
This reverts commit e17f6fb2dc.
2015-04-14 19:10:58 +02: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
David Adam
665314b240 translations: update new strings 2015-04-13 22:19:29 +08:00
Sanne Wouda
cb1e3c501d Simplify begin_header production
The TOK_END is swallowed by the subsequent job_list anyway.
2015-04-13 13:23:59 +08:00
Sanne Wouda
9e8e5af064 Add test cases for parsing 'begin' without ';' 2015-04-13 13:23:59 +08:00
Sanne Wouda
fd731fb74f Modify parser to accept 'begin' without ';'
Examples that work as expected (even completions don't get confused):

$ begin true; end;
$ begin if true; end; end
$ begin if true; echo hi; end

The last example correctly expects another 'end' to match 'begin'.

Fixes #1248.
2015-04-13 13:23:59 +08:00
David Adam
d1a56139e1 fish.cpp: check for fishd from old version and warn if reachable
Work on #1730.

With thanks to Andrew Lutomirski (github.com/amluto) for the SOCK_DGRAM
trick:
https://github.com/fish-shell/fish-shell/pull/2023#issuecomment-91866965
2015-04-12 23:58:55 +08:00
David Adam
3408b2759e .gitignore: fishd is dead 2015-04-12 23:58:55 +08:00
Sanne Wouda
fbe28fd5d8 Tombstone only when explicitly removing a function.
Do not tombstone a function when it is evicted normally from the LRU cache.
This broke changing `fish_function_path`, since that would evict all nodes,
resulting in accidental tombstones, which caused autoloaded functions to
never be reloaded.

See #213.
2015-04-08 10:46:38 -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