Commit Graph

857 Commits

Author SHA1 Message Date
Kurtis Rader
bd299e96b2 implement status is-breakpoint
This implements `status is-breakpoint` that returns true if the current
shell prompt is displayed in the context of a `breakpoint` command.

This also fixes several bugs. Most notably making `breakpoint` a no-op if
the shell isn't interactive. Also, typing `breakpoint` at an interactive
prompt should be an error rather than creating a new nested debugging
context.

Partial fix for #1310
2017-06-20 17:18:59 -07:00
Kurtis Rader
82f5fb507d fix echo -h
In addition to fixing `echo -h` this includes some debugging related
cleanups I made while investigating the issue.

Fixes #4120
2017-06-18 22:10:19 -07:00
Kurtis Rader
59a11188df fixes for previous commit
Turns out the Travis environments are less forgiving than my system. Add
missing include. Change subsystem init order in fkr.
2017-06-18 16:42:26 -07:00
Kurtis Rader
93dad29ec6 set COLUMNS and LINES earlier
Fixes #4141
2017-06-18 15:38:52 -07:00
Kurtis Rader
385e40540c fix issues with builtin_function()
This does several things. It fixes `builtin_function()` so that errors it
emits are displayed. As part of doing that I've removed the unnecessary
`out_err` parameter to make the interface like every other builtin.

This also fixes a regression introduced by #4000 which was attempting to
fix a bug introduced by #3649.

Fixes #4139
2017-06-18 12:55:14 -07:00
Alan Somers
0e954e4764 Fix the build on FreeBSD with Clang
NULL expands to nullptr which cannot be cast to an int.  Replace it with
0 in wcsfilecmp.

Fixes issue #4136
2017-06-17 22:51:25 -07:00
Alan Somers
652faa1a13 Rename __assert to __fish_assert
FreeBSD and possibly other platforms define __assert in their C
libraries.

Fixes #4133
2017-06-17 22:41:24 -07:00
Kurtis Rader
e44934cf87 remove leftover debug printf 2017-06-17 18:39:16 -07:00
Kurtis Rader
1e9c9e01e5 refactor wgetopt.cpp to reduce complexity 2017-06-17 17:09:01 -07:00
Kurtis Rader
a312abdeb8 fix wgetopt_long() handling of short opts
Fixes #4131
2017-06-17 16:00:33 -07:00
Kurtis Rader
af22bf3501 style cleanups (make style-all) 2017-06-16 21:01:57 -07:00
Kurtis Rader
d22743dad0 change help only cmd opts interface 2017-06-16 21:01:57 -07:00
Kurtis Rader
37b8cfaeba avoid struct name clashes
Running the tests on travis revealed that some compilers (or at least
with some options) call the wrong struct constructor if there is more
than one struct with the same name but differing definitions.
2017-06-16 21:01:57 -07:00
Kurtis Rader
a114492223 more builtin refactoring 2017-06-16 21:01:57 -07:00
Kurtis Rader
d910b7af7d fix some lint warnings 2017-06-16 21:01:57 -07:00
Kurtis Rader
ffdabace5e more builtin style cleanup 2017-06-16 21:01:57 -07:00
Kurtis Rader
b480b117a9 split builtin realpath into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
a665d532c3 split builtin exit into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
b530d175e7 split builtin return into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
422b1bd066 split builtin bg into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
79e74d0ebb split builtin fg into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
070d204d9b split builtin pwd into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
175570b7ed lint cleanup 2017-06-16 21:01:56 -07:00
Kurtis Rader
a6d6ded9a5 split builtin contains into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
bda6426bf7 split builtin builtin into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
551bd39889 split builtin command into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
fded427c6a split builtin cd into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
7840d53ecf split builtin source into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
52709e8051 split builtin disown into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
1d4a0fb091 split builtin echo into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
59e90123ea change naming convention for parsing opts 2017-06-16 21:01:56 -07:00
Kurtis Rader
044f5512e2 split builtin function into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
1c91ec9dfa split builtin random into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
e7f87c08e1 split builtin status and read into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
ef8a0c93ea split builtin history into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
2079b4292e fix minor bug introduced by previous refactoring 2017-06-16 21:01:56 -07:00
Kurtis Rader
00ed221b5a split builtin functions into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
1b9824ae46 split builtin emit into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
b20ffca3e2 split builtin block into its own module 2017-06-16 21:01:56 -07:00
Kurtis Rader
7a6a766e0a remove dead code
Remove code for the `__fish_parse` builin that has been commented out
for three years. Add a call to `parse_dump_tree()` to fish_indent.
2017-06-16 21:01:56 -07:00
Kurtis Rader
a6227f6c3a split builtin bind into its own module
As part of putting the `bind` command code into its own module refactor
how it parses its flags.
2017-06-16 21:01:56 -07:00
Kurtis Rader
59a2e1bcbc refactor string flag parsing
Hoist the code for parsing flags out of each individual subcommand and
into a function shared by all the subcommands. This reduces duplication
and potential for error. More importantly it makes the code that
actually implements the subcommand more prominent.
2017-06-11 20:29:11 -07:00
Kurtis Rader
f6c9bfc0e8 implement string lower and string upper
Fixes #4080
2017-06-10 17:35:25 -07:00
Kurtis Rader
5e94650645 more wgetopt cleanup 2017-06-10 12:30:36 -07:00
Kurtis Rader
cbae738882 don't use wgetopt_long_only()
Fixes #4114
2017-06-10 12:30:36 -07:00
Kurtis Rader
75e9c863f6 normalize flag parsing 2017-06-10 12:30:36 -07:00
Kurtis Rader
57184a8ed9 normalize string option parsing code 2017-06-08 20:56:24 -07:00
Kurtis Rader
6841de5e4b work around Haiku stdio bug
The Haiku stdio library has a bug. If we set stdout to unbuffered and it
is attached to a tty it discards wide output. Given how we interact with
the tty it should be safe to replace the problematic `fputwc()` calls
with simple `write()` calls. This does depend on the rest of the fish
code that writes to the tty to ultimately call write() which is true at
this time and should remain true in the future.

Fixes #4100
2017-06-04 21:01:26 -07:00
Kurtis Rader
3d3c6cc495 change job notification message
This came up in the context of issue #4068. This change makes it more
likely that the correct translation from english to another language
will be done for the "Job ... has {ended,stopped}" message.
2017-05-30 22:47:24 -07:00
Kurtis Rader
eff2a3c3a3 fix bug in ~ completion
Fix bug introduced by commit c114cbc9a that causes only the first match
for a ~ completion to be available for selection.

Fixes #4075
2017-05-27 16:29:24 -07:00