Commit graph

61 commits

Author SHA1 Message Date
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
049bd227ed Remove EXPAND_SKIP_PROCESS, which did not actually work 2014-10-15 12:43:06 -07:00
ridiculousfish
b511550917 Revert "Prepend ./ to "flag-like file" wildcard expansions and completions"
This reverts commit 316d7004a3.

Reverts fix for 1519 in light of #1713

Conflicts:
	fish_tests.cpp
2014-09-25 22:18:36 -07:00
ridiculousfish
316d7004a3 Prepend ./ to "flag-like file" wildcard expansions and completions
If a wildcard or completion expands to a file that begins with
one or more dashes, prepend a ./ to it so that it doesn't get
parsed as an option.

Fixes #1519
2014-09-24 22:06:43 -07:00
Kevin Ballard
3981b644d6 Fix double expansions ($$foo)
Double expansions of variables had the following issues:

* `"$$foo"` threw an error no matter what the value of `$foo` was.
* `set -l foo ''; echo $$foo` threw an error because of the expansion of
  `$foo` to `''`.

With this change, double expansion always works properly. When
double-expanding a multi-valued variable, in a double-quoted string the
first word of the inner expansion is used for the outer expansion, and
outside of a quoted string every word is used for the double-expansion
in each of the arguments.

    > set -l foo bar baz
    > set -l bar one two
    > set -l baz three four
    > echo "$$foo"
    one two baz
    > echo $$foo
    one two three four
2014-08-20 21:45:07 -07:00
ridiculousfish
ad6367018b Excise use of parser_t's error() functionality. Thread a
parse_error_list_t through all of the expand functions, enabling them to
report errors more directly. Improve aspects of error reporting for
expansion failures.
2014-03-21 17:13:33 -07:00
ridiculousfish
0e421ea31d Various cleanup and tweaking of backtrace messages 2013-12-16 15:33:20 -08:00
ridiculousfish
9f6223311e Large cleanup and refactoring of unescape() function. 2013-11-24 22:58:39 -08:00
ridiculousfish
92099c7af2 Initial abbreviation work. Tests currently fail. 2013-07-19 12:41:34 -07:00
ridiculousfish
464187491f Formatting 2013-06-02 01:14:26 -07:00
ridiculousfish
908b07527e Support for fuzzy completions
https://github.com/fish-shell/fish-shell/issues/568
https://github.com/fish-shell/fish-shell/issues/528
2013-05-25 15:41:18 -07:00
ridiculousfish
373cca0bf6 Formatting 2013-01-12 12:55:23 -08:00
ridiculousfish
b32fcc7a8e Don't call expand_home_directory from within parser_t::test - it may hang
https://github.com/fish-shell/fish-shell/issues/512
2013-01-12 12:53:40 -08:00
ridiculousfish
edb973fadc Hack around xdm's dumb assumption that the login shell is POSIX compliant so we no longer kill OpenSUSE
https://github.com/fish-shell/fish-shell/issues/367
Also fix some formatting
2013-01-04 13:09:01 -08:00
ridiculousfish
644607c29f Eliminate str2wcs 2012-12-19 13:31:06 -08:00
ridiculousfish
9992b8eb0e Apply new indentation, brace, and whitespace style 2012-11-18 16:30:30 -08:00
Łukasz Niemier
47df1ae40a Remove trailing whitespaces and change tabs to spaces 2012-11-18 11:23:22 +01:00
ridiculousfish
5bbf220077 Fix bug where underlining was failing for paths prefixed with ~
Fixes https://github.com/fish-shell/fish-shell/issues/292
2012-08-23 11:21:35 -07:00
ridiculousfish
0e2a625815 Added some limited support for autosuggesting processes 2012-08-07 00:01:48 -07:00
ridiculousfish
7a46227141 More warning fixes and switching from int to long or size_t 2012-08-04 13:02:44 -07:00
ridiculousfish
33c6410809 Implemented process expansion on OS X
Also fixed issue where process expansion would always fail for processes with spaces
Fixes https://github.com/fish-shell/fish-shell/issues/56
2012-07-16 12:06:02 -07:00
ridiculousfish
40e4f49dbe Disable process expansion in autosuggestions
Addresses https://github.com/fish-shell/fish-shell/issues/39
2012-06-29 16:40:54 -07:00
ridiculousfish
b7ba252965 Restore implicit cd for paths starting with ., .., or ~ 2012-06-02 14:04:25 -07:00
ridiculousfish
9bcc7df96f Lots of modernization changed
Removed wcsdupcat
2012-05-09 02:33:42 -07:00
ridiculousfish
a515db4aea Some work to allow completions to be evaluated off of the main thread 2012-02-24 12:19:31 -08:00
ridiculousfish
191eeab589 Cleanup expand_escape_variable 2012-02-08 00:15:06 -08:00
ridiculousfish
5ad6849d4e Work on new history implementation 2012-02-05 16:42:24 -08:00
ridiculousfish
62f49c55ce Clean up uses of completion_t 2012-02-01 16:27:14 -08:00
ridiculousfish
0b4b6c498d Migrated off of old variant of expand_one that used halloc 2012-01-31 21:30:09 -08:00
ridiculousfish
79e0405f6a Yet more un-hallocing 2012-01-30 02:23:58 -08:00
Siteshwar Vashisht
1a5d866a91 buggy-auto-complete is not so buggy now. Merged branch 'buggy-auto-complete' into CPlusPlus 2012-01-29 14:11:39 +05:30
ridiculousfish
da85bdc401 More work on the instanced parser 2012-01-22 20:47:13 -08:00
ridiculousfish
7e486e3b5c More work towards instanced parser 2012-01-20 11:24:43 -08:00
Siteshwar Vashisht
140ead65b6 Converted all auto completion calls (on pressing tab) to use std::vector<completion_t>, bugs are yet to be fixed 2012-01-16 22:26:47 +05:30
Peter Ammon
a359f45df2 Redesign new environment variables to use env_var_t instead of wcstring
Migrate uses of empty() to missing() to distinguish between empty variable and unset variable
2012-01-14 02:42:17 -08:00
ridiculousfish
b67eaa3abd More migration to the STL 2011-12-26 22:51:34 -08:00
ridiculousfish
8d2f107d61 Some changes to migrate towards C++ and a multithreaded model 2011-12-26 19:18:46 -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
axel
d7396ac59f Fix bug causing flood of error messages in terminal when trying to highlight an invalid command, reported by Denilson F. de Sa.
darcs-hash:20080204230905-ac50b-0829b69835347e5875656ae735181b724f10de2a.gz
2008-02-05 09:09:05 +10:00
axel
2d05b1c1b4 Add compiler warnings for some common incorrect usage of functions, such as forgetting to cast null pointers to variadic functions
darcs-hash:20061019151947-ac50b-4043638a7a830fa80fd918f92365f5afe3ff208a.gz
2006-10-20 01:19:47 +10:00
axel
303473f20c Fix incorrect usage of the term subshell when command substitution was meant
darcs-hash:20060822143831-ac50b-cb5267a6434adcbd5bafb452d688bee06c23d4d6.gz
2006-08-23 00:38:31 +10:00
axel
5c8d9bd13c Minor duplicate code removal
darcs-hash:20060720130246-ac50b-b41daebb302e1cbadf2a4cf812d936edbda85926.gz
2006-07-20 23:02:46 +10:00
axel
5688035680 Large number of sourcecode comment edits, and some minor code polish
darcs-hash:20060620005010-ac50b-eaeae9a6242a37c1e34831e1a0b2ee2b4e7a012e.gz
2006-06-20 10:50:10 +10:00
axel
4e38d3bc8c Minor comment edits, reindentation and other code formating changes
darcs-hash:20060615103706-ac50b-ad9f7060e40f5a786877e95f027688c90f43b6ec.gz
2006-06-15 20:37:06 +10:00
axel
04b142208d Make it possible to specify scope of a variable to be erased or tested. Also make sure set exits with a non-zero exit status when erasing fails.
darcs-hash:20060604201451-ac50b-4ea0212c513b33be40559dfe8d65c1446c53f682.gz
2006-06-05 06:14:51 +10:00
axel
d46dade284 Rename function expand_variable_array to tokenize_variable_array and move it from expand.c to common.c, since it is used by fish_pager, which should not depend on expand.o
darcs-hash:20060529111342-ac50b-315d7dcf04e05fa8f32e16801e6793ac4e4e022e.gz
2006-05-29 21:13:42 +10:00
axel
b746a803a9 Add validator check to make sure the second argument to 'for' is 'in'
darcs-hash:20060521221604-ac50b-5bc4ce217a08304f68b97b20e908ea1279fe26e9.gz
2006-05-22 08:16:04 +10:00
axel
1c2cbb00bc Major update to the ahead-of-time syntax checker
darcs-hash:20060521192524-ac50b-48713f826558e66ef21046d1bb779623cc2fd97a.gz
2006-05-22 05:25:24 +10:00
axel
d1c9bca2e9 Another halloc:ification of fish. Halloc has been extended to allow registering function calls, this has allowed the creation of halloc-handled arraylists, stringbuffers, etc. More job parsing halloc-ification has reduced the error handling code to only a shadow of it's former self
darcs-hash:20060209155020-ac50b-e119c5293ce2368e252cfc01b98ab7c629fdd678.gz
2006-02-10 01:50:20 +10:00
axel
e756f7d619 Minor code cleanup, don't use expand_escape and expand_unescape any more
darcs-hash:20060206151552-ac50b-e2229d096926461f643fdcdfc79ef1ff01344a35.gz
2006-02-07 01:15:52 +10:00