Commit graph

113 commits

Author SHA1 Message Date
ridiculousfish
b04e874e43 Teach fish how to push and pop blocks even in the face of no_exec. All tests finally pass.
https://github.com/fish-shell/fish-shell/issues/624
2013-03-25 16:06:12 -07:00
Siteshwar Vashisht
d9c9760aac Initial version of printf builtin 2013-03-02 20:54:12 +05:30
ridiculousfish
6d522e6ed6 First round of fixes based on cppcheck
https://github.com/fish-shell/fish-shell/issues/575
2013-02-16 00:02:40 -08:00
ridiculousfish
8d95d0834d First stab at builtin set_color. Moved set_color.cpp to builtin_set_color.cpp and taught fish about it. 2013-02-14 15:52:24 -08:00
Jan Kanis
9a89da3b33 merge branch 'bug-537' and branch 'bug-read-ctrlC'. This should fix both #537 and #516 2013-02-05 23:16:18 +01:00
ridiculousfish
ad8d68dd43 Make subcommands modify $status, and make builtin_set not modify status unless it fails
https://github.com/fish-shell/fish-shell/issues/547
https://github.com/fish-shell/fish-shell/issues/214
2013-01-31 15:57:08 -08:00
Jan Kanis
a3b497b271 rename reader_data_t.interruptible to exit_on_interrupt 2013-01-22 11:28:04 +01:00
Jan Kanis
970d05df39 make the read builtin respect ctrl-C 2013-01-20 23:38:21 +01:00
ridiculousfish
6d61919941 Rearrange some variables for possibly better alignment. int -> bool 2013-01-19 13:32:12 -08:00
ridiculousfish
8d4a701f86 Implement builtin [ via builtin test 2013-01-05 01:30:03 -08:00
ridiculousfish
37bdb20092 Make event_block_t.event not a reference
Stylistic tweaks
2012-12-22 12:40:34 -08:00
ridiculousfish
e31431140a Formatting 2012-12-22 12:21:31 -08:00
ridiculousfish
8a66ba6c35 Merge branch 'event-bug-test' of git://github.com/JanKanis/fish-shell into JanKanis-event-bug-test 2012-12-22 12:20:41 -08:00
Jan Kanis
8a446f43ff include fixes and suggestions from code review 2012-12-22 18:38:28 +01:00
ridiculousfish
2a91a7640c Make echo recognize -ne 2012-12-20 18:10:08 -08:00
ridiculousfish
0b1e371880 Changes to work recognition per https://github.com/fish-shell/fish-shell/issues/384
Word movement should be very similar to fish 1.x
backward-kill-word remains more liberal, but now stops at any of {,'"=}
2012-12-20 17:37:09 -08:00
Jan Kanis
30392bf66a reference'ize event.cpp/h 2012-12-20 16:13:14 +01:00
Jan Kanis
af3059ab2a Allow 'emit' to accept event arguments 2012-12-20 16:13:00 +01:00
ridiculousfish
644607c29f Eliminate str2wcs 2012-12-19 13:31:06 -08:00
Cheer Xiao
09b1eee5d0 Random fixes to comments. 2012-12-16 12:23:24 +08:00
ridiculousfish
eec6db0a23 forward-word should accept a word of an autosuggestion
https://github.com/fish-shell/fish-shell/issues/435
2012-12-10 16:23:08 -08:00
ridiculousfish
6fc9e6f21e Make tok_first return a wcstring instead of a wchar_t* 2012-11-21 22:23:48 -08:00
ridiculousfish
26678682ca Fix indentation of switch statements 2012-11-19 00:31:03 -08:00
ridiculousfish
9992b8eb0e Apply new indentation, brace, and whitespace style 2012-11-18 16:30:30 -08:00
ridiculousfish
dc8cc39bc8 Don't autosuggest in builtin_read
https://github.com/fish-shell/fish-shell/issues/29
2012-11-18 02:43:35 -08:00
ridiculousfish
d76f880faf Support for fish_right_prompt
Fixes https://github.com/fish-shell/fish-shell/issues/80
2012-11-07 19:59:20 -08:00
ridiculousfish
e52cf09bc1 Simplify handling of escape sequences in echo -e 2012-10-17 17:08:45 -07:00
ridiculousfish
57de1388e8 Make the \c special character in echo suppress the newline too 2012-10-17 02:59:43 -07:00
ridiculousfish
7ee0ce745e Implement -e option to echo (to interpret special characters), and -E to not interpret them
https://github.com/fish-shell/fish-shell/issues/337
2012-10-17 02:56:03 -07:00
Ian Munsie
ffc03735e8 Don't barf when ending a FAKE block
After updating, fish would immediately die when started in an xterm from
my window manager (wmii) with a message like:

fish: builtin.cpp:3357: int builtin_end(parser_t&, wchar_t**): Assertion `false' failed.
fish: Job 1, “~/code/fish-shell/fish” terminated by signal SIGABRT (Abort)

Starting fish from an existing shell worked, and running it on other
machines that I was only SSHing into worked as well. I did discover that
on one machine starting git from one specific directory
(/home/ian/bml/kernel) would cause this failure, but starting from any
other directory worked as normal. I'm not entirely sure what
circumstances contribute to this failure - starting from a copy of the
kernel directory works fine.

The failure only started with the following commit, which introduced the
assert(false):

commit d788c84440
Made type property of block_t constant and private
Further work towards cleaning up block_t hierarchy

Looking at this fail in gdb:

(gdb) r
Starting program: /home/ian/code/fish-shell/fish
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
fish: builtin.cpp:3357: int builtin_end(parser_t&, wchar_t**): Assertion `false' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff6c82475 in *__GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
    function=0x548520 "int builtin_end(parser_t&, wchar_t**)") at assert.c:81
(gdb) up 3
3357                    assert(false); //should never get here
(gdb) p parser.current_block->type()
$1 = FAKE

So this happens when we run an end command for a FAKE block.

The below patch adds an empty case for FAKE blocks to avoid hitting the
assert. I would need to study the code in more detail to understand if
we should even be executing this code if we are in a FAKE block, but
this patch seems to solve the issue for me.

Signed-off-by: Ian Munsie <darkstarsword@gmail.com>
2012-09-22 23:51:41 -07:00
ridiculousfish
1a59346b51 Changed "elseif" to "else if" 2012-09-03 13:24:01 -07:00
ridiculousfish
ff124465fd Clean up some warnings and some unused if-related code 2012-09-01 12:29:00 -07:00
ridiculousfish
cc1395797e First stab at elseif implementation 2012-09-01 01:46:14 -07:00
ridiculousfish
95de6cf5a7 Migrated function_data_t out of base block class
Removed an auto_ptr (yay)
2012-08-26 23:30:23 -07:00
ridiculousfish
d788c84440 Made type property of block_t constant and private
Further work towards cleaning up block_t hierarchy
2012-08-26 23:16:20 -07:00
ridiculousfish
96046ffd30 First stab at getting rid of the ugly state1, state2 properties of block_t 2012-08-26 22:42:29 -07:00
ridiculousfish
61686aff34 Adopt posix_spawn (!)
Rewrite IO chains to be a vector of pointers, instead of a linked list
Removed io_transmogrify
2012-08-15 00:57:56 -07:00
ridiculousfish
84729c4dfa Additional warnings cleanup, effective C++ violations, dead code removal 2012-08-05 13:24:33 -07:00
ridiculousfish
c67702a498 Cleaned up lots of typecasts, simplified some string handling 2012-08-04 15:11:43 -07:00
ridiculousfish
b904aa78e8 Additional warning cleanup and switching from int to size_t where appropriate 2012-08-04 11:34:45 -07:00
ridiculousfish
8185bee4b8 Lots of work towards making fish build without warnings on Mountain Lion, mostly in terms of using size_t instead of int 2012-08-04 11:34:45 -07:00
ridiculousfish
e7cbcc83a4 Implemented history deletion from fish_config
Fixes https://github.com/fish-shell/fish-shell/issues/250
2012-07-27 00:31:00 -07:00
ridiculousfish
62c49f13ce Switch from std::list to std::vector in a few places to reduce compiled code size 2012-07-24 22:32:11 -07:00
ridiculousfish
261bf12c91 Lots of miscellaneous cleanup. Unified the path_get_cd_path, path_allocate_cd_path, etc. functions 2012-07-20 22:11:05 -07:00
maxfl
0c03b6ddc7 Allow 'contains' builtin to return index
Add an option -i/--index to the contains builtin to print the index
of first coincidence.
2012-07-10 16:21:00 -07:00
maxfl
232ed91ec7 Fix read default prompt. It's now single line. 2012-07-06 15:31:45 -07:00
maxfl
ea4b37d5c5 Fixed case behaviour
* case no properly handles -h and --help flags, i.e. treats it as
  pattern
* fixed case escaping:
The following expressions now work correctly:
switch '*'
  echo '*'
  echo Match any string
end
switch '*'
  echo '\*'
  echo Match asterix
end
switch '\\'
  echo '\\\\'
  echo Match slash
end

The same for '?' sign
2012-07-05 14:17:25 -07:00
ridiculousfish
7bbc7a61ce Clarify the function name deferral in functions_def
Prohibit making a function with an empty name
2012-07-01 15:33:50 -07:00
maxfl
ab62fe6496 Update funced
* Editor mode is no the default
* Use -i or --interactive or -e fish to edit function in interactive
  mode
* tmpname is now created with random number added and check that file
  do not already exist
* check $TMPDIR existence and put /tmp if it does not exist
* There is an undocumented feature to use functions, started with dash.
  Introduce necessary changes to funced, functions, def_function()
  in order to make it work properly.
* Delete editor guessing. Use $EDITOR variable or -e key
2012-07-01 14:20:43 -07:00
Kevin Ballard
adfd3c1098 Don't blow away $status in switch statements
Tweak the switch and case builtins to not blow away $status
inappropriately. Fixes issue #161.
2012-06-24 13:43:44 -07:00