Commit graph

1820 commits

Author SHA1 Message Date
Christopher Nilsson
2583638f4b Merge commit 'refs/merge-requests/8' of git://gitorious.org/fish-shell/fish-shell into merge_request_8 2011-01-11 23:22:27 +11:00
Dylan Smith
11360b018f mimedb: Search all the defaults.list files rather than just the first.
The first defaults.list file found should not override all the other ones,
it just needs to be searched first.

E.g. For me (cat ~/.local/share/applications/defaults.list) returns
[Default Applications]
text/html=chromium-browser.desktop

So this should be used for text/html mimetypes, but the other defaults.list
files should be searched for other mimetypes.

I had to refactor get_filename so that it can return all the filenames, so
I changed it to append_filenames that appends all the filenames to a list
and provided a wrapper function called get_filename.
2010-12-02 23:55:45 +08:00
Grissiom
bdfc62184d fish_indent: indent "case" with the same level as "swith" 2010-12-02 23:42:48 +08:00
Grissiom
74f06d550a fish_indent: don't indent commands after a pipe
commands after a pipe tend to be at the same line of previous command.
So don't indent them.
2010-12-02 23:42:24 +08:00
James Bowlin
46986ad4c2 Use eix instead of emerge when possible
On Gentoo the eix program is MUCH faster than emerge for listing package
names.  I've left the emerge code in as a 2nd choice because not every
Gentoo system has eix installed (although they should).  Also,  the
emerge code didn't seem to produce any output on my system.

Signed-off-by: Grissiom <chaos.proton@gmail.com>
2010-12-02 01:33:56 +08:00
Dylan Smith
6a5d6471c5 mimedb: Search for exact mime type match in search_ini. 2010-12-02 01:19:56 +08:00
Dylan Smith
cf0850edfd mimedb: Add seperator between directory and filename in file_exists.
get_filename tried to work around this with hardcoded strings that end with
a '/', but would fail to work properly for environment variables
XDG_DATA_HOME or XDG_DATA_DIRS that don't do the same.
2010-12-02 01:16:29 +08:00
Dylan Smith
fd4ac87382 funcsave: Fixed error and help handling.
Renamed references to the previous command name of save_function to
funcsave, and returned an error after printing the help text when no
arguments are specified.
2010-12-02 01:13:51 +08:00
Dylan Smith
164144f126 default_key_bindings: Added mappings for ctrl-arrow keys.
On debian and ubuntu these control sequences are output while using
gnome-terminal and xterm.
2010-12-02 01:13:04 +08:00
Dylan Smith
f2ad4a2e8e Makefile: test for xsel directory before trying to clean it.
This avoids the users seeing ignored errors for make -C  clean.
2010-12-02 01:12:34 +08:00
Grissiom
df23913bb8 fish_indent: only output fd number when have to
The original patch is own by Dylan. I just did some cleaning and
reformating.
2010-12-01 13:05:10 +08:00
Dylan Smith
4ccf26fbcc builtin: count should not accept options, not even help
It is documented this way, but the common builtin_run function was
checking for -h or --help before even calling the builtin_count. Without
this functions like funced can't use count to check the number of
arguments before checking for -h or --help.

Signed-off-by: Grissiom <chaos.proton@gmail.com>
2010-11-26 19:00:18 +08:00
Dylan Smith
081e277fe4 builtin: read's --shell long option should require an argument
The short option -s doesn't need it and it won't be used.

Signed-off-by: Grissiom <chaos.proton@gmail.com>
2010-11-25 19:09:31 +08:00
Christopher Nilsson
dcecab384a Merge commit 'refs/merge-requests/6' of git://gitorious.org/fish-shell/fish-shell into merge_req_6 2010-11-24 22:34:29 +11:00
James Vega
4f9b07e979 Allow fish_greeting to be NULL or an array
Treat fish_greeting as a whole when show up the greeting messages. And
the user may want to set fish_greeting to an null value or an array.
This requires that the variable be quoted when used as an argument for
switch in __fish_config_interactive.

Signed-off-by: James Vega <jamessan@debian.org>
[modified the commit message]
Signed-off-by: Grissiom <chaos.proton@gmail.com>
2010-11-24 00:49:15 +08:00
Grissiom
9b97c55546 add test case for 364d3dbbf8 2010-11-24 00:35:56 +08:00
Dylan Smith
364d3dbbf8 exec: Don't format status returned directly from builtin function
The builtin function returns the raw status, which is not the same as
the integer return by waitpid. Therefore, the WIF macros shouldn't be
used for checking or obtaining the status.

This bug can be seen by executing (eval false). The builtin eval
function returns 1, but proc_format_status misinterprets it as a signal
by checking WIFSIGNALED, so adds 128 to the status to return 129.

Signed-off-by: Grissiom <chaos.proton@gmail.com>
2010-11-24 00:27:16 +08:00
James Vega
9f3a4d1640 Fix some spelling mistakes
Fix spelling mistakes in various bits of the documentation.

Signed-off-by: James Vega <jamessan@debian.org>
Signed-off-by: Grissiom <chaos.proton@gmail.com>
2010-11-23 23:50:49 +08:00
Dylan Smith
5fca92994f help.fish: Fix the sed expression to find anchors with id or name
Previously the expression only searched for anchors with a name
attribute, but doxygen 1.7.1 is producing anchors with the id attribute
instead. The sed expression allows both cases for compatibility.

I also used single quotes for the sed expression to avoid escaping
double quotes.

Signed-off-by: Grissiom <chaos.proton@gmail.com>
2010-11-23 23:37:09 +08:00
Grissiom
fefd17fe5e add test case for 6b243fbc 2010-11-23 23:05:21 +08:00
Dylan Smith
6b243fbcd3 eval: (eval false) should return an error status
This also caused (isatty < /dev/null) to return 0 since it uses eval,
and (ls | cat) to output using the classify indicator style since it
uses isatty. This is how I found the bug.

Reviewed-by: Grissiom <chaos.proton@gmail.com>
2010-11-22 19:36:42 +08:00
Dylan Smith
82f8c3834e Makefile: Provide PACKAGE_TARNAME for autoconf default docdir
docdir was previously being set to "${prefix}/share/doc/${PACKAGE_NAME}"
when it wasn't explicitely set on configuration using --docdir. Without
this appearing in the Makefile, some files silently get silently
installed directly into ${prefix}/share/doc instead within a fish
subdirectory.

I also added datarootdir to fix an autoconf warning,  since autoconf
normally would use it for the directory paths (e.g. docdir =
${datarootdir}/doc/${PACKAGE_TARNAME}). The autoconf generated configure
script has a hack to fix this, but states: "FIXME: This hack should be
removed a few years after 2.60."
2010-11-22 19:05:06 +08:00
Grissiom
e0ba91db31 Revert "use is_interactive instead of isatty to test whether we are in interactive mode"
This reverts commit ceba377ab8.
2010-11-22 08:43:21 +08:00
Grissiom
fa148bf59f break long lines 2010-11-22 08:42:57 +08:00
Christopher Nilsson
1b0ce33669 Merged changes from codemonkey and grissiom branches
Conflicts:
	kill.c
	seq.in
2010-11-12 02:07:14 +11:00
David Frascone
0cf2a1eb33 Fixed negative indices in the seq command 2010-11-05 09:34:42 -06:00
David Frascone
8a46a8ecb2 This change allows for customizing of the clipboard buffer, by supplying
a command to accept the "copy".  So, you add your clipboard buffer command
to an environment variable, and custom commands will be used for the copy
program.  Very useful when your OS is not naitively supported by fish.
2010-11-05 09:32:05 -06:00
David Frascone
4f0221bc4f Modify getopt string to force posix compliance. I forgot why I
needed this -- but -- some options were not working right.
2010-11-05 09:29:10 -06:00
David Frascone
ce08bb2ad2 The grep on the commands would sometimes output errors, causing noise and
breaking scripts.
2010-11-05 09:26:26 -06:00
David Frascone
93f797326e Optimized the result of the xsel check, so that it is cached.
It is called very often, and causes a significant performace hit.  The
availability of xsel is not likely to change during the invocation of
the shell.
2010-11-05 09:22:28 -06:00
Grissiom
ceba377ab8 use is_interactive instead of isatty to test whether we are in interactive mode 2010-10-13 04:30:23 +08:00
Grissiom
b9b6e867df check allocated memory when setting SHLVL 2010-10-08 09:38:06 +08:00
Grissiom
f47caefdb9 fix a memory allocation bug in commit 1e27024d75 2010-10-08 09:01:25 +08:00
James Buren
41ae7bccc2 silences some warnings outputted by gcc with -Wall and -Wextra 2010-10-08 08:43:57 +08:00
Grissiom
1e27024d75 accumulate SHLVL env variable at startup 2010-10-08 08:35:22 +08:00
Grissiom
6654fff377 fix null reference when erase TERM env
Way to reproduce:

> set -e TERM
fish: function contains_internal called with null value for argument a.
fish: This is a bug. If you can reproduce it,  please send a bug report
to fish-users@lists.sf.net.
fish: Backtrace:
/home/grissiom/sysroot/bin/fish(show_stackframe+0x1a) [0x43519a]
/home/grissiom/sysroot/bin/fish(contains_internal+0xce) [0x4373ee]
/home/grissiom/sysroot/bin/fish(reader_write_title+0x59) [0x424179]
/home/grissiom/sysroot/bin/fish() [0x4242d5]
/home/grissiom/sysroot/bin/fish(reader_readline+0x54) [0x425974]
/home/grissiom/sysroot/bin/fish(reader_read+0xba) [0x42742a]
/home/grissiom/sysroot/bin/fish(main+0x4be) [0x43b19e]
/lib64/libc.so.6(__libc_start_main+0xfd) [0x7fcbe0dcbb6d]
/home/grissiom/sysroot/bin/fish() [0x408c29]
2010-10-06 20:58:13 +08:00
Grissiom
89d999df72 some optimization on filling prompt_buff 2010-10-06 20:37:30 +08:00
Grissiom
a941d82be3 don't expand variables in no_exec mode
We couldn't know variables values unless execute commands, so disable
variable expansion in no_exec mode.
2010-10-06 11:37:59 +08:00
Grissiom
694cdf5ae1 update .gitignore 2010-10-05 21:14:43 +08:00
Grissiom
2bfe4afea2 add prof target 2010-10-05 02:23:18 +08:00
Grissiom
d559c3fe2e fix bug in build debug targe 2010-10-05 02:22:33 +08:00
Grissiom
27df727ca1 don't parse the options that should be passed to fish scripts
This commit makes fish_parse_opt stop at first non-option argument,
which expected as fish script name and pass the remaining argument to
that script. I also updated the test cases.
2010-10-03 11:46:26 +08:00
Grissiom
8910226d2f only count the last line of promt when caculate prompt width 2010-09-24 19:01:13 +08:00
Grissiom
04f58b1a31 ignore tmp staff in tests/ 2010-09-24 11:34:35 +08:00
Grissiom
1b9dd0c75f Merge remote branch 'origin/otherchirps-dev' 2010-09-19 14:12:30 +08:00
Grissiom
a7af415b6a call original grep in sgrep
functions/grep.fish will set the GREP_OPTIONS, which will ruin sgrep's
effort.
2010-09-19 13:56:30 +08:00
Grissiom
f8a5a59513 Revert "match the whole command for git completion"
This reverts commit d957d23d8f.
Use __fish_git_using_command to test commands and __fish_contains_opt to
test arguments.
2010-09-19 11:04:24 +08:00
Grissiom
ac3dfb3f96 don't complete file names for git checkout 2010-09-19 00:19:44 +08:00
Grissiom
d957d23d8f match the whole command for git completion 2010-09-19 00:17:53 +08:00
Grissiom
d049947801 event_fire( 0 ); => event_fire( NULL ); 2010-09-18 21:30:02 +08:00