Commit graph

1799 commits

Author SHA1 Message Date
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
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
Grissiom
21a10c3c74 use $() in Makefile var expansion 2010-09-18 21:29:05 +08:00
Grissiom
04951f8b34 reader_read( 0... => reader_read( STDIN_FILENO 2010-09-18 20:26:54 +08:00
Grissiom
c08bae6aeb configure xsel in configure phase
... and with the same arguments of fish
2010-09-18 14:31:18 +08:00
Grissiom
3aa107c4ae add XSEL_BIN var in configure.ac 2010-09-18 13:49:03 +08:00
Grissiom
e196091714 make clean should clean xsel and make distclean should delete it 2010-09-18 13:41:27 +08:00
Grissiom
d35d65cc40 use variables as xsel target 2010-09-18 13:27:34 +08:00
Grissiom
7f7b30959b don't make xsel in subshell 2010-09-18 13:14:59 +08:00
Grissiom
70322077d2 remove trialing spaces #2 2010-09-18 10:18:26 +08:00
Grissiom
f529b2e057 upgrade xsel to 1.2.0
xsel 1.0 begin to support UFT-8.
2010-09-18 10:14:14 +08:00
Grissiom
c6372a1b3f remove trailing spaces
This is done by `sed -i -e 's/[ \t]*$//' *.[c,h]`, which should not
introduce any functionality change.
2010-09-18 09:51:16 +08:00
Grissiom
41b8db063c add git submodule completion
Merged from http://github.com/weavejester/fish-git
2010-09-17 16:38:26 +08:00
Grissiom
1b16758d7e Fix cd prompt fail on the case that CDPATH have variables 2010-09-17 16:01:44 +08:00
Grissiom
51b5adc306 ignore ~ backup files 2010-09-16 13:32:18 +08:00
Grissiom
56f8993b8c ignore po/*.gmo 2010-09-16 13:31:49 +08:00
Ben Hoskings
8c4d1ca587 Added .gitignore. 2010-09-16 13:30:59 +08:00
Christopher Nilsson
ec8b3593f3 added '-c' option to the functions.txt docs. 2010-09-12 20:29:34 +10:00
Christopher Nilsson
5c9b42e260 'functions --copy': added sanity check on new function name.
Now matches function create behaviour, running the new function name through
wcsfuncname() and parser_keywords_is_reserved(), before allowing the copy.
2010-09-12 13:16:11 +10:00
Christopher Nilsson
7914c92824 replaced the functions '--rename' option with '--copy'.
Copying the function implementation was the main point. Actually removing the original isn't necessary, as that
functionality already exists (functions -e).
2010-09-09 23:48:18 +10:00
Christopher Nilsson
208be0f4d4 Adding '--rename' option to 'functions' builtin.
Aim is to allow an existing function to be renamed, allowing some basic function chaining.

Example:

> function foo
     echo Hello
  end
> foo
Hello
> functions --rename foo bar
> foo
fish: Unknown command 'foo'
> bar
Hello
> functions --rename fish_prompt old_prompt
> function fish_prompt
      printf "{Boo!}%s" (old_prompt)
  end
{Boo!}>

Note in the last case, the new fish_prompt is calling its old definition.
2010-09-08 03:31:05 +10:00
Ben Hoskings
7cfac5bb59 Fix an fprintf() type warning in set_color.c by using "%s". 2010-04-09 16:05:19 -07:00
Ben Hoskings
1bd09bfd40 Fix casting warnings in screen.c / s_update() by casting al_get() twice to convert type and then size, instead of both at once. 2010-04-09 16:05:18 -07:00