aboutsummaryrefslogtreecommitdiffhomepage
path: root/env.cpp
Commit message (Collapse)AuthorAge
* use configure to define NOMACROSGravatar David Adam2014-12-21
| | | | (added in 9ec808a4c)
* Solaris build fixes: pick the right curses more of the timeGravatar David Adam2014-12-21
|
* Make C_ (gettext used in completions) return wcstringGravatar ridiculousfish2014-10-30
|
* Change how arrays and environment variables interact.Gravatar ridiculousfish2014-10-12
| | | | | | | | | | | | Prior to this change, inherited environment variables would be split on colons, becoming an array. This change eliminates that behavior. Now environment variables are always split on the record separator character (ASCII 0x1e), with the exception of a short whitelist of PATH, MANPATH, CDPATH. Likewise, exported variables are also exported delimited by rs, with the exception of the above whitelist. Fixes #1374, also see #1656
* Raise debug level to 2 on annoying Changing language to English messageGravatar ridiculousfish2014-10-08
| | | | Fixes #1386
* env.cpp: correctly check variable_can_be_arrayGravatar David Adam2014-10-08
| | | | Closes #1746.
* Find fishd file even when $HOME is unsetGravatar Kevin Ballard2014-10-01
| | | | | | | | | | env.cpp sets up $HOME based on the current user, if it's not inherited from the environment. fishd_get_config should be using the same calculated value of $HOME. To that end, move universal variable initialization to after $HOME is set up, and read the value from the fish environment instead of using getenv(). Fixes #1725.
* Export $HOME if we have to calculate itGravatar Kevin Ballard2014-10-01
| | | | | | | | If $HOME is unset in the environment, fish calculates it with getpwnam(). However, it wasn't being exported. Just like the $USER calculation, $HOME should probably be exported, because everyone will assume that it's an environment variable (as opposed to an unexported global variable).
* Further support for term24bit. Teach output.cpp what to do with it.Gravatar ridiculousfish2014-09-19
|
* Initial work to support for term-24bit ("true color")Gravatar ridiculousfish2014-09-19
|
* Decrement SHLVL when running `exec`Gravatar Kevin Ballard2014-09-19
| | | | | | | | | | | `exec` removes fish from the shell "stack", so SHLVL needs to be decremented to match. This means `exec fish` will result in the same SHLVL in the new fish instance. Also tweak the SHLVL logic to interpret an environment SHLVL of "3foo" as garbage instead of as the value "3". Fixes #1693.
* Fix $SHLVLGravatar Kevin Ballard2014-08-29
| | | | | Due to being read-only, SHLVL wasn't being incremented properly for recursive invocations of fish.
* set: Print an error when setting `umask` to a bad valueGravatar Kevin Ballard2014-08-21
| | | | | | | | | Repurpose the ENV_INVALID return value for env_set(), which wasn't currently used by anything. When a bad value is passed for the 'umask' key, return ENV_INVALID to signal this and print a good error message from the `set` builtin. This makes `set umask foo` properly produce an error.
* Improve history robustness against corrupt filesGravatar ridiculousfish2014-07-29
| | | | Fixes #1581
* Clean up default environment variables.Gravatar ridiculousfish2014-07-25
| | | | | | This stops unconditionally setting values for HOME and USER, if we find those values in the environment. It also saves about 16KB on OS X, which getpwuid allocates.
* Turn the 'mode' parameter of environment variables into an enumGravatar ridiculousfish2014-07-13
|
* Change how we separate toplevel and global scopesGravatar Kevin Ballard2014-07-13
| | | | | | | | | | | | Instead of introducing a new local scope at the point of `set`, merely push a new local scope at the end of env_init(). This means we have a single toplevel local scope across the lifetime of the fish process, which means that set -l foo bar echo $foo behaves as expected, without modifying the global environment.
* Add an optional mode to env_get_string()Gravatar Kevin Ballard2014-07-12
| | | | | | | | The mode restricts the scope in which the variable is searched for. Use this new restricted scope functionality in the `set` builtin. This fixes `set -g` to not show local shadowing variable values, and also allows for scoped erasing of slices.
* set: Print an error when setting a special var in the wrong scopeGravatar Kevin Ballard2014-07-12
| | | | | | | | | When attempting to set a readonly or electric variable in the local or universal scopes, print an appropriate error. Similarly, print an error when setting an electric variable as exported. In most cases this is simply a nicer error instead of the 'read-only' one, but for the 'umask' variable it prevents `set -l umask 0023` from silently changing the global value.
* Mark COLUMNS/LINES as electric varsGravatar Kevin Ballard2014-07-12
| | | | | | They're dynamically calculated, so they qualify. This also removes them from the list of exported global variables, because they're actually not exported.
* set: Don't treat toplevel scope the same as globalGravatar Kevin Ballard2014-07-12
| | | | | | | | | | | When using the `set` command with the -l flag, if we're at the top level, create a temporary local scope. This makes query/assignment behavior be consistent with the value-printing behavior. This works by marking the current block as needing to pop the environment if a local scope was pushed. I assume this is safe to do. I also assume the current block is the right one to modify, rather than trying to walk up the stack to the root.
* Rewrite env_exists() for better scope handlingGravatar Kevin Ballard2014-07-12
| | | | | | env_exists() wasn't properly handling multiple scopes in some cases, notably with readonly/electric variables. Rewrite it to operate in a more straightforward fashion.
* Don't allow readonly/electric values to come in through the envGravatar Kevin Ballard2014-07-12
| | | | | | | | | | When initializing fish, ignore any inherited environment variables that match any of the readonly or electric variable names. This prevents really weird behavior when e.g. fish is launched with COLUMNS already set to something. In that case, testing $COLUMNS within fish behaves normally, but any subprocesses get the value that fish itself had inherited.
* Must load universal variables earlier, and issue a barrier after erasingGravatar ridiculousfish2014-07-06
| | | | | | one. Fixes #1526
* env.cpp: allow all users to change $USER and $HOMEGravatar David Adam2014-06-28
| | | | Closes 1425 (https://github.com/fish-shell/fish-shell/issues/1425)
* Remove env_universal.h and env_universal.cpp from projectGravatar ridiculousfish2014-06-18
|
* Universal variable callbacks should only be announced for changedGravatar ridiculousfish2014-06-16
| | | | values, not every value. Also support erase notifications.
* Migrate global functions out of env_universal. Have env operate directlyGravatar ridiculousfish2014-06-15
| | | | on an env_universal_t.
* Teach env_universal_remove to directly report whether the variable wasGravatar ridiculousfish2014-06-13
| | | | successfully removed.
* Removal of more fishd artifacts and headersGravatar ridiculousfish2014-06-09
|
* Remove large parts of fishd interaction, includingGravatar ridiculousfish2014-06-06
| | | | env_universal_server
* avoid symlink attacks in __fish_print_packages and spawning fishdGravatar David Adam2014-05-12
| | | | | | | | | | * use $XDG_CACHE_HOME for __fish_print_packages completion caches * when starting fishd, redirect fishd output to /dev/null, not a predictable path Fix for CVE-2014-3219. Closes #1440.
* Shorten compilation timesGravatar Konrad Borowski2014-05-01
| | | | | | | | | | Now fish shell stores version is a small file called by other files. This means that a slight change which modifies one file won't cause many of files to recompile. The compilation unit is intentionally small, this is by design. The smaller it is, the faster it will recompile, and it will be compiled a lot.
* Migrate universal variables to env_var_t structure. EncapsulateGravatar ridiculousfish2014-04-25
| | | | universal variable storage into a class for better testability.
* Set $fish_bind_mode to default on fish startup; set $fish_key_bindingsGravatar Julian Aron Prenner2014-01-19
| | | | when sourcing fish_vi_mode.fish
* Fix for issue where we compute a default USER variable, but never setGravatar ridiculousfish2014-01-12
| | | | its value.
* Miscellaneous optimizations to reduce string copyingGravatar ridiculousfish2014-01-07
|
* Stop insisting on trying to add /usr/bin and /bin to $PATH.Gravatar ridiculousfish2013-08-27
| | | | https://github.com/fish-shell/fish-shell/pull/854
* Generate version numbers dynamicallyGravatar David Adam (zanchey)2013-08-11
| | | | | | | | This commit hooks the Makefile up to generate a FISH_BUILD_VERSION symbol and kills off PACKAGE_VERSION in .cpp files. It also modifies the tarball generation script to add the necessary version file for releases.
* Fix some warnings exposed by -WallGravatar ridiculousfish2013-07-16
|
* Fix $LINES = $COLUMNS bugGravatar Dag Odenhall2013-05-24
| | | | Fixes #745
* Rely on $PWD instead of getcwd() more oftenGravatar ridiculousfish2013-04-27
| | | | Fixes https://github.com/fish-shell/fish-shell/issues/696
* Hack up dcgettext to try to fix CentOS buildGravatar ridiculousfish2013-04-08
| | | | https://github.com/fish-shell/fish-shell/issues/645
* Kill termio.h and sys/termios.hGravatar David Adam (zanchey)2013-03-05
| | | | | | | | | | | On FreeBSD, compilation complains that "this file includes <sys/termios.h> which is deprecated, use <termios.h> instead". On Linux and FreeBSD, <sys/termios.h> literally just pulls in <termios.h>. On OS X and Solaris, <termios.h> pulls in <sys/termios.h>. <termio.h> doesn't exist on FreeBSD or Mac OS X, and on Linux is marked as deprecated and just includes <termios.h>. It does exist on Solaris, but no `struct termio` is ever actually used in the codebase.
* Cleanup and simplify null_terminated_array_t and its clientsGravatar ridiculousfish2013-02-22
|
* Null initialize an ivar (oops)Gravatar ridiculousfish2013-02-19
|
* Large set of changes to how PATH is handled. Changed fish to no longer ↵Gravatar ridiculousfish2013-02-19
| | | | | | modify PATH in share/config.fish. Introduced variable fish_user_paths, and a glue function __fish_reconstruct_path that splices together PATH with fish_user_paths. Changed fish to no longer validate changes to PATH unless the paths are new (i.e. don't recheck what's already there). Modified certain sets to store const wchar_t instead of wcstring to save a few allocations. https://github.com/fish-shell/fish-shell/issues/527
* First round of fixes based on cppcheckGravatar ridiculousfish2013-02-16
| | | | https://github.com/fish-shell/fish-shell/issues/575
* First stab at builtin set_color. Moved set_color.cpp to ↵Gravatar ridiculousfish2013-02-14
| | | | builtin_set_color.cpp and taught fish about it.
* Fixed broken export_funcGravatar Siteshwar Vashisht2013-02-12
| | | | Fix for https://github.com/fish-shell/fish-shell/issues/573