aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
Commit message (Collapse)AuthorAge
* deal with broken ttys on MS WindowsGravatar Kurtis Rader2016-06-18
| | | | | | | | The tty device timestamps on MS Windows aren't usable because they're always the current time. So fish can't use them to decide if the entire prompt needs to be repainted. Fixes #2859
* bg had also had wrong exit code for some errorsGravatar Aaron Gyes2016-06-18
| | | | | Stop printing usage information when error isn't a usage problem. Add simple test for bg and fg
* fg: fix exit code (was 1 if success else 0)Gravatar Aaron Gyes2016-06-18
| | | | returning a C boolean for builtin_fg success was backwards
* remove unset vars from the environmentGravatar Kurtis Rader2016-06-15
| | | | | | | Remove vars from the environment that are no longer set. Simplify the code by removing an unnecessary loop. Add some tests. Fixes #3124
* trivial locale cleanupsGravatar Kurtis Rader2016-06-14
| | | | | Clarify the purpose of the `N_()` macro. Remove inconsistent capitalization of two strings in the parser module.
* Lint CleanupGravatar Aaron Gyes2016-06-14
| | | | | | | This remove some stores that clang assures me are very dead. And an assert() for an unlikely NULL pointer dereference I can't quite figure out.
* use fish_wcwidth rather than wcwidthGravatar Kurtis Rader2016-06-14
| | | | Minor cleanup related to issue #2199.
* Restyle touched .cpp filesGravatar Aaron Gyes2016-06-12
|
* Improve fish_indent -w error outputGravatar Aaron Gyes2016-06-12
| | | | Show small usage blurb, add newline to end.
* Hand-build 256, 24-bit color esc strings same wayGravatar Aaron Gyes2016-06-12
| | | | | ... using snprintf() for the 256-color function in same manner as the 24-bit function.
* Improve comments, update DoxyfileGravatar Aaron Gyes2016-06-12
| | | | Some changes were cribbed from #1317
* Fix env_universal_common.cpp filesize comparisons.Gravatar Aaron Gyes2016-06-12
| | | | | | | | * if (result == ULLONG_MAX) is always false, likely a typo as result is unsigned long, and the comment says ULONG_MAX. * use off_t instead of size_t for file size where it can mismatch st_size's type in stat.h
* Don't allow specifying an fd with a caret redirectionGravatar ridiculousfish2016-06-12
| | | | | | | | For example, an argument 12345^ is a real argument, not a redirection There's no reason to use ^ here instead of >, and it's annoying to git users. Fixes #1873
* Error on -w without a path before reading stdinGravatar Aaron Gyes2016-06-12
| | | | | Oops, `fish_indent -w` just sits there waiting for input if nothing is pointing at it, only to give user the error afterwards.
* Fix crash when fish_indent is using stdin with -wGravatar Aaron Gyes2016-06-10
| | | | | | | | | | | When given no path, the logic was happy to try to use an unitialized output_location. $ fish_indent -w < test.fish Opening "(null)" failed: Bad address Initialize the string, and repair the logic to catch this case and report the problem correctly.
* don't print header for each jobGravatar Corey Ford2016-06-08
|
* Merge pull request #3118 from floam/headerdoc-fixesGravatar Aaron Gyes2016-06-05
|\ | | | | | | | | | | | | Update Xcode project, HeaderDoc comments. Fix various invalid HeaderDoc comments. Normalize autoload.cpp/autoload.h as an example of something closer to "proper" HeaderDoc formatting. Have clang/Xcode validate HeaderDoc comments. Remove key_reader.cpp from Xcode project.
| * Be a bit more consistent and proper.Gravatar Aaron Gyes2016-06-05
| |
| * These autoload comment should be HeaderDoc comments.Gravatar Aaron Gyes2016-06-05
| |
| * Repair various invalid HeaderDoc comments.Gravatar Aaron Gyes2016-06-05
| | | | | | | | | | Enable build setting to allow Xcode to complain about invalid comments.
* | remove dependency on dcgettext()Gravatar Kurtis Rader2016-06-05
| | | | | | | | | | While fixing issue #3110 I noticed there is exactly one place we use dcgettext() and that use is completely unnecessary. So remove it.
* | simplify, and fix, setting the current localeGravatar Kurtis Rader2016-06-05
|/ | | | | | | | | | Fix test setup bogosities. Specifically, they weren't hermetic with respect to locale env vars. Rewrite the handling of locale vars to simplify the code and make it more like the pattern most programs employ. Fixes #3110
* put curses/terminfo vars into the environmentGravatar Kurtis Rader2016-06-03
| | | | | | | | | | | | | We need to actually export the curses/terminfo env vars in order for `setupterm()` to be able to use them. While fixing this I reworked the fallback logic implemented by @zanchey in response to issue #1060 in order to simplify the logic and clarify the error messages. This does not allow someone to change the curses/terminfo env vars after the first prompt is displayed (you can but it won't affect the current fish process). It only makes it possible to set `TERM`, `TERMINFO`, and `TERMINFO_DIRS` in *config.fish* or similar config file and have them be honored by fish.
* Don't insert prefix for non-prefix matchesGravatar Fabian Homborg2016-06-02
| | | | | | | | | | | | | | | | | | The issue here is that when inserting a common prefix for e.g. a substring match, we increase the amount of available candidates again to things the user didn't want. An example is in share/functions - a completion for "inter" would previously expand to "__fish_" because it matched: - __fish_config_interactive.fish - __fish_print_interfaces.fish - __fish_print_lpr_printers.fish The completion afterwards would then show 189 possible matches, only three of which (the above) actually matched the original "inter". Fixes #3089.
* mention nullglob exceptions in failglob error msgGravatar Beni Cherniavsky-Paskin2016-06-02
|
* fix lint error in wgettext()Gravatar Kurtis Rader2016-06-01
| | | | | | | | | | | | | | | | Cppcheck was complaining about the `return val.c_str()` at the end of the `wgettext()` function. That would normally a bug since the lifetime of `val` ends when the function returns. In this particular case that's not true because the string is interned in a cache. Nonetheless, rather than suppress the lint warning I decided to modify the API to be more idiomatic. In the process of fixing the aforementioned lint warning I fixed several other lint errors in that module. This required making our copy of `wgetopt()` compatible with the rest of the fish code. Specifically, by removing its local definitions of the "_" macro so it uses the same macro used everywhere else in the fish code. The sooner we kill the use of wide chars the better.
* Make string match -rnv workGravatar Fabian Homborg2016-05-31
| | | | Fixes #3098.
* simplify some fish_tests codeGravatar Kurtis Rader2016-05-30
| | | | | This came to my attention because cppcheck was warning about possibly dereferncing a NULL pointer.
* fix random lint issuesGravatar Kurtis Rader2016-05-29
| | | | | | | | This only eliminates errors reported by `make lint`. It shouldn't cause any functional changes. This change does remove several functions that are unused. It also removes the `desc_arr` variable which is both unused and out of date with reality.
* Allow suggestion when selecting in pagerGravatar Fabian Homborg2016-05-27
| | | | Also mentioned in #3016.
* Allow autosuggestion after completionGravatar Fabian Homborg2016-05-27
| | | | | | | | | It seems kinda silly to not directly do it, but it was explicitly stopped in the code. I'm quite good at deleting that, aren't I? Fixes #3016.
* fix some style bogosities that crept inGravatar Kurtis Rader2016-05-27
|
* Fix wide char related tests on CygwinGravatar Kurtis Rader2016-05-26
| | | | | | | | This makes the wide char tests run by `./fish_tests` pass on systems where sizeof wchar_t is two (e.g., Cygwin). In doing so it corrects several problems with the underlying code in module *utf8.cpp* such as allowing five and six byte UTF-8 sequences. They were allowed by the original Unicode proposal but are not allowed by the adopted standard.
* Remove $versionGravatar Fabian Homborg2016-05-26
| | | | | It's too generic a name - which both does not communicate what it is and prevents someone else from using it.
* tty driver ignore lnext (\cV) and werase (\cW)Gravatar Kurtis Rader2016-05-25
| | | | | | | | | | Configure the tty driver to ignore the lnext (\cV) and werase (\cW) characters so they can be bound to fish functions. Correct the `fish_key_bindings` program to initialize the tty in the same manner as the `fish` program. Fixes #3064
* kill: Remove xsel integrationGravatar Fabian Homborg2016-05-25
| | | | | | | Overwriting the user's clipboard by default is annoying and contributors don't use it. This is better served via an explicit binding that calls e.g. `xsel`.
* add option to modify script being restyledGravatar Camille Scholtz2016-05-22
| | | | | | This change allows the user to specify the script name on the CLI in addition to being redirected from stdin. It also adds a `-w` flag to write the modified script to the original file.
* fix building on CygwinGravatar Kurtis Rader2016-05-19
| | | | | | | Cygwin still doesn't support any of the backtrace functions. Also, remove a spurious newline from a debug message. Fixes #2993
* make fish buildable on OS X Snow LeopardGravatar Kurtis Rader2016-05-19
| | | | | | | | | | | | | I noticed that the `test_convert()` function was randomly failing when run on OS X Snow Leopard. I tracked it down to the `mbrtowc()` function on that OS being broken. Explicitly testing for UTF-8 prefixes that identify a sequence longer than four bytes (which the Unicode standard made illegal long ago) keeps us from having encoding errors on those OS's. This also makes the errors reported by the `test_convert()` function actually useful and readable. Lastly, it makes it possible to build fish on OS X Snow Leopard.
* move convert_digit from fallback to commonGravatar David Adam2016-05-18
| | | | It's not required as part of fallback functions any more.
* fallback: drop fallbacks for C99/C++0x wide character functionsGravatar David Adam2016-05-18
| | | | | | | | Drops configure check for wcsdup, wcslen, wcscasecmp, wcsncasecmp, wcwidth, wcswidth, wcstok, fputwc, fgetwc, and wcstol. Drop the fallback implementations of these on non-Snow Leopard platforms. Work on #2999.
* fallback: remove fwprintf and friends fallbacksGravatar David Adam2016-05-18
| | | | | | | All modern operating systems implement fwprintf, including NetBSD (which introduced them in 2005). Work on #2999.
* fallback: remove sysconf fallbackGravatar David Adam2016-05-18
| | | | | | | sysconf was introduced in IEEE Std 1003.1-1988 (POSIX.1) and exists on every system I can find. Work on #2999.
* configure: drop fwprintf testGravatar David Adam2016-05-18
| | | | | | | | | | | fwprintf would segfault on DragonFly BSD 1.4.0, released in January 2006. This was fixed by DragonFly BSD 1.4.4, released in April 2006. It seems unlikely that anyone is still running a ten-year-old, unsupported version, and hoping that fish will continue to build. I've checked this in virtual machines. Work on #2999.
* configure: drop tests for ancient platformsGravatar David Adam2016-05-18
| | | | Work on #2999.
* add (or restore) config.h to all filesGravatar David Adam2016-05-18
| | | | | | | | The autoconf-generated config.h contains a number of directives which may alter the behaviour of system headers on certain platforms. Always include it in every C++ file as the first include. Closes #2993.
* make debug() output more usefulGravatar Kurtis Rader2016-05-17
| | | | | | | | | | This change does several things. First, and most important, it allows dumping the "n" most recent stack frames on each debug() call. Second, it demangles the C++ symbols. Third, it prepends each debug() message with the debug level. Unrelated to the above I've replaced all `assert(!is_forked_child());` statements with `ASSERT_IS_NOT_FORKED_CHILD()` for consistency.
* trivial fix to fish_tests.cppGravatar Kurtis Rader2016-05-16
| | | | | | | Fix a minor bogosity I noticed while building fish on OS X Snow Leopard. It's technically not a bug because only old compilers complain about the original statement but this change makes the one line this changes consistent with the rest of the fish code.
* add `function --shadow-builtin` flagGravatar Kurtis Rader2016-05-14
| | | | | | | | | | | | | | It's currently too easy for someone to bork their shell by doing something like `function test; return 0; end`. That's obviously a silly, contrived, example but the point is that novice users who learn about functions are prone to do something like that without realizing it will bork the shell. Even expert users who know about the `test` builtin might forget that, say, `pwd` is a builtin. This change adds a `--shadow-builtin` flag that must be specified to indicate you know what you're doing. Fixes #3000
* rename get_is_interactive and remove stupid testGravatar Kurtis Rader2016-05-14
| | | | | | I'm doing this as part of fixing issue #2980. The code for managing tty modes and job control is a horrible mess. This is a very tiny step towards improving the situation.