In the C/POSIX locale EOF on the tty wasn't handled correctly due to a change
a few months ago to fix an unrelated problem with that locale. What is
surprising is that the core fish code doesn't explicitly depend on
input_common_readch returning WEOF if a character isn't seen within
`wait_on_escape_ms` after an escape.
Fixes#3214
Add some debug output like there is for 24bit mode.
I see now there is no need to setup terminal here - we get called early
sometimes for colors to work in config.fish to work but that is not so fatal.
Just check cur_term and trust get called again soon.
```
~ $ set -e TERM; fish
Assertion failed: (!is_missing), function c_str, file src/env.cpp, line 690.
fish: 'fish' terminated by signal SIGABRT (Abort)
```
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.
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.
I missed restyling a few "switch" blocks to make them consistent with the rest
of the code base. This fixes that oversight. This should be the final step in
restyling the C++ code to have a consistent style. This also includes a few
trivial cleanups elsewhere.
I also missed restyling the "complete" module when working my way from a to z
so this final change includes restyling that module.
Total lint errors decreased 36%. Cppcheck errors went from 47 to 24. Oclint P2
errors went from 819 to 778. Oclint P3 errors went from 3252 to 1842.
Resolves#2902.
Remove the "make iwyu" build target. Move the functionality into the
recently introduced lint.fish script. Fix a lot, but not all, of the
include-what-you-use errors. Specifically, it fixes all of the IWYU errors
on my OS X server but only removes some of them on my Ubuntu 14.04 server.
Fixes#2957
The swap-selection-start-stop function goes to the other end of the highlighted text, the equivalent of `o' for vim visual mode.
Add binding to the swap-selection-start-stop function, `o' when in visual
mode.
Document swap-selection-start-stop, begin-selection, end-selection, kill-selection.
input_mapping_execute, when passed false for allow_commands, will return
R_NULL. However currently it does this unconditionally, even if we don't
have any commands. This defeats our read-ahead optimization, so we
always read and process one byte at a time. This caused pasting to be
much slower.
Fixes#2215
This change eliminates global variables like stdout_buffer. Instead we wrap up
the IO information into a new struct io_streams_t, and thread that through
every builtin. This makes the intent clearer, gives us a place to hang new IO
data, and eliminates the ugly global state management like builtin_push_io.
Previously, the process's inherited $TERM value would be used.
This prevented users from being able to set $TERM in their config.fish files.
To make matters worse, the error message would print the computed $TERM value,
giving the mistaken impression that it was being used.
Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au>
This change moves source files into a src/ directory,
and puts object files into an obj/ directory. The Makefile
and xcode project are updated accordingly.
Fixes#1866