aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/env.cpp
Commit message (Collapse)AuthorAge
* 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
* 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.
* 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.
* 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.
* 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.
* fix fork debug printf() callsGravatar Kurtis Rader2016-05-05
| | | | | | | | The fork (create new process) related debugging messages rely on an undocumented env var and use `printf()` rather than `debug()`. There are also errors in how the fork count is tracked that this fixes. Fixes #2995
* lint cleanup: eliminate "redundant" errorsGravatar Kurtis Rader2016-05-04
| | | | | This removes some pointless parentheses but the primary focus is removing redundancies like unnecessary "else" clauses.
* Remove use of __environGravatar ridiculousfish2016-04-30
| | | | It has apparently never worked. Fixes #2988
* restyle env module to match project styleGravatar Kurtis Rader2016-04-28
| | | | | | Reduces lint errors from 90 to 72 (-20%). Line count from 1719 to 1298 (-24%). Another step in resolving issue #2902.
* add better support for IWYU and fix thingsGravatar Kurtis Rader2016-04-26
| | | | | | | | | 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
* fix handling of non-ASCII chars in C localeGravatar Kurtis Rader2016-03-20
| | | | | | | | | | | | The relevant standards allow the mbtowc/mbrtowc functions to reject non-ASCII characters (i.e., chars with the high bit set) when the locale is C or POSIX. The BSD libraries (e.g., on OS X) don't do this but the GNU libraries (e.g., on Linux) do. Like most programs we need the C/POSIX locales to allow arbitrary bytes. So explicitly check if we're in a single-byte locale (which would also include ISO-8859 variants) and simply pass-thru the chars without encoding or decoding. Fixes #2802.
* Save a few string allocations when importing environment variablesGravatar ridiculousfish2016-03-05
|
* Prefer the first, not last, of any env var duplicatesGravatar ridiculousfish2016-03-05
| | | | | If envp contains duplicate environment variables, use the first value, not the last value. Fixes #2784.
* Miscellaneous cleanup and dead code removalGravatar ridiculousfish2016-02-19
| | | | Noticed by cppcheck
* Additional work on unifying cd autosuggestions with completeGravatar ridiculousfish2016-02-18
|
* Remove a debug() guarded by a surprising get_is_interactiveGravatar ridiculousfish2016-02-16
| | | | | | get_is_interactive can crash if proc_init has not been called. Fixes #2280
* allow configuring the escape delay timeoutGravatar Kurtis Rader2016-01-17
| | | | | | | | Introduce a "fish_escape_delay_ms" variable to allow the user to configure the delay used when seeing a bare escape before assuming no other characters will be received that might match a bound character sequence. This is primarily useful for vi mode so that a bare escape character (i.e., keystroke) can switch to vi "insert" to "normal" mode in a timely fashion.
* env.cpp: warn when wgetcwd() failsGravatar David Adam2015-11-28
| | | | Closes #2321
* Make 'set -ql' search up to function scopeGravatar ridiculousfish2015-10-23
| | | | | | | | | | | | | Previously 'set -ql' would only look for variables in the immediate local scope. This was not very useful. It's also arguably surprising, since a 'set -l' in a function, followed by a 'set -ql' in a child block, would fail. There was also no way to check for a function-scoped variable, since omitting the scope would also pull in global variables. We could revisit this and introduce an explicit function scope. Fixes #2502
* Stop exporting fish configuration directories (argh)Gravatar ridiculousfish2015-09-09
|
* Factor function environment preparation into its own functionGravatar ridiculousfish2015-08-15
|
* Merge branch 'master' into iwyuGravatar David Adam2015-07-26
|
* Migrate source files into src/ directoryGravatar ridiculousfish2015-07-24
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