aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/env.c
Commit message (Collapse)AuthorAge
* refactor: remove some unused includes (#19747)zeertzjq2022-08-13
| | | | | - Remove autocmd.h from fileio.h - Remove normal.h from main.h - Move bufinfo_T from undo_defs.h to undo.c
* refactor: replace char_u with charDundar Goc2022-08-12
| | | | Work on https://github.com/neovim/neovim/issues/459
* feat(lua): print source locations of lua callbacks (#19597)ii142022-08-03
| | | Co-authored-by: ii14 <ii14@users.noreply.github.com>
* refactor: replace char_uDundar Goc2022-07-02
| | | | Work on https://github.com/neovim/neovim/issues/459
* feat: stdpath('run'), /tmp/nvim.user/ #18993Justin M. Keyes2022-06-30
| | | | | | | | | | | | | | | | Problem: - Since c57f6b28d71d #8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Store sockets in stdpath('run') ($XDG_RUNTIME_DIR). - Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims. - Make ok() actually useful. - Introduce assert_nolog(). closes #3517 closes #17093
* refactor: replace char_u #18429dundargoc2022-06-28
| | | Work on https://github.com/neovim/neovim/issues/459
* refactor(uncrustify): set maximum number of consecutive newlines to 2 (#18695)dundargoc2022-05-25
|
* refactor: replace char_u variables and functions with charDundar Goc2022-05-16
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u variables and functions with charDundar Goc2022-05-11
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u variables and functions with charDundar Goc2022-05-09
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u variables and functions with charDundar Goc2022-05-03
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: convert macros to all-caps (#17895)dundargoc2022-04-24
| | | Closes https://github.com/neovim/neovim/issues/6297
* vim-patch:8.2.4750: small pieces of dead code (#18113)dundargoc2022-04-15
| | | | | | Problem: Small pieces of dead code. Solution: Remove the dead code. (Goc Dundar, closes vim/vim#10190) Rename the qftf_cb struct member to avoid confusion. https://github.com/vim/vim/commit/b836658a04ee5456deca2ee523de9efe51252da3
* refactor: fix clint warnings (#17682)dundargoc2022-03-13
|
* vim-patch:8.2.0942: expanding to local dir after homedir keeps "~/"zeertzjq2022-02-07
| | | | | | | Problem: Expanding to local dir after homedir keeps "~/". Solution: Adjust modify_fname(). (Christian Brabandt, closes vim/vim#6205, closes vim/vim#5979) https://github.com/vim/vim/commit/0e390f40e944036fb558a63b91238cfda128d95f
* refactor: reduce number of explicit char casts (#16077)dundargoc2021-11-16
| | | * refactor: reduce number of explicit char casts
* vim-patch:8.1.0743: giving error messages is not flexibleJames McCoy2021-11-01
| | | | | | | | | Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes vim/vim#3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts. https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
* Refactor/uncrustify (#15790)dundargoc2021-09-29
| | | | | | | | | | | | | * refactor: format with uncrustify * fixup(dundar): fix functions comments * fixup(dundar): remove space between variable and ++/-- * fixup(dundar): better workaround for macro attributes This is done to be able to better use uncrustify rules for macros * fixup(justin): make preprocessors follow neovim style guide
* refactor: reformat with uncrustify #15736dundargoc2021-09-20
| | | | * fix function parameter comments * remove space after star in function names
* refactor: format files with uncrustify #15663dundargoc2021-09-14
|
* refactor(map): remove extra-allocating map_new/map_free functionsBjörn Linse2021-08-22
| | | | | | | | | | Note: the reason for removing them is not that there after this refactor is no use of them, but rather that having them available is an anti-pattern: they manange an _extra_ heap allocation which has nothing to do with the functionality of the map itself (khash manages the real buffers internally). In case there happens to be a reason to allocate the map structure itself later, this should be made explicit using xcalloc/xfree calls.
* Use uv_os_homedir and current directory as backup when $HOME is not set (#13657)ffanzhang2021-01-10
| | | | | | Close https://github.com/neovim/neovim/issues/8614 Use uv_os_homedir and current directory as backup if HOME env is not set. Allocate homedir only if var is not NULL.
* win: avoid duplicate separators in $PATH #12869Justin M. Keyes2020-09-08
| | | | | | | | | | | | | | | Seems like redundant env var separators (";" on Windows) in $PATH can cause weird behavior. From #7377: > After some time, system(['win32yank', '-o']) and system('win32yank -o') > start returning different results: specifically first returns an > empty string. > > 1. $PATH weirdly contains double semicolon followed by path to the > “installation directory” (unpacked directory from archive). > 2. If I run `let $PATH=substitute($PATH, ';;', ';', 'g')` the problem is fixed. close #7377 ref 224f99b85d311ebd31451db13b66e4a3c7e51938
* env: try find library dir (like /usr[/local]/lib/nvim) and add it to &rtpBjörn Linse2020-02-07
|
* os/env: fix pvs/v781Jan Edmund Lazo2019-12-26
|
* os_getenvname_at_index: Handle Windows env vars whose name starts with =James McCoy2019-12-11
|
* Add os_getfullenv_size/os_copyfullenvJames McCoy2019-12-11
|
* jobstart now supports env/clear_envMatthieu Coudron2019-12-11
| | | | to modify the environment of the launched job.
* TUI/thread: guard env map from potential race with unibilium #11259erw72019-10-20
| | | unibi_from_term calls getenv internally, so exclusive control is required.
* Fix potential deadlock #11151erw72019-10-04
| | | | | ELOG may call os_getenv and os_setenv internally. In that case, a deadlock occurs.
* Revert "win/os_env_exists(): workaround libuv bug #10734"Daniel Hahler2019-09-25
| | | | This reverts commit 278c5d452c2cbc436a9cc317407ae6021a226c3a.
* env: use putenv_s for LC_ALL, LANG, etc. #11050erw72019-09-22
| | | | | | | | Problem: ":lang messages en_US.UTF-8" no longer overrides the language detected from the environment (at startup). Solution: In os_setenv, special-case "LC_ALL", "LANG", et al. to use putenv_s instead of uv_os_setenv. fixes #11045
* vim-patch:8.1.1897: may free memory twice when out of memory (#10827)Jan Edmund Lazo2019-08-22
| | | | | | Problem: May free memory twice when out of memory. Solution: Check that backslash_halve_save() returns a different pointer. (Dominique Pelle, closes vim/vim#4847) https://github.com/vim/vim/commit/f1552d07d715b437d941659479942c2543b02bd4
* utf16_to_utf8: align with libuvJustin M. Keyes2019-08-15
| | | | | | | | | - take a size parameter - return libuv error code - handle error in caller only (avoid redundant messages) https://github.com/libuv/libuv/commit/53995a3825d23eacd01e2bcfa35642c4a188d32b https://github.com/libuv/libuv/commit/4c945f49365ab4d6e1b07bf0ef2893455dc04622
* Merge #10098 'win: fix msg_puts_printf()'Justin M. Keyes2019-08-12
|\
| * Fix problems with message catalog directoryerw72019-06-09
| | | | | | | | | | | | | | | | - In appimage, the message catalog is not used because there is no message catalog in LOCALE_INSTALL_DIR. Therefore, change to exepath/../share/locale instead of LOCALE_INSTALL_DIR. - The old vim style($runtime/lang) is no longer used. Thus all relevant code is removed.
* | win/env: Vim-compat: Empty string deletes env var #10743erw72019-08-11
| | | | | | | | | | | | | | | | - Windows: `set FOO=` deletes environment variable FOO, and there is no way to set empty string expect by calling the API. - Vim-compatible: `:let $FOO=""` deletes the environment variable. - See also Test_WindowsHome(). ref: https://github.com/neovim/neovim/pull/10657#issuecomment-516368089
* | win: expand nested env var #10662erw72019-08-11
| | | | | | | | Vim-compatible behavior for a Windows edge case.
* | win/os_env_exists(): workaround libuv bug #10734Justin M. Keyes2019-08-10
| | | | | | | | | | | | | | | | | | | | os_env_exists() fails on MSVC build: os_env_exists:104: uv_os_getenv(EMPTY_VAR) failed: -4094 UNKNOWN - Revert 396a3945c4eba733b3a99a7ded217af83a400791 - HACK: Windows: return TRUE if uv_os_getenv() returns UV_UNKNOWN, until libuv bug is fixed: https://github.com/libuv/libuv/issues/2413 ref https://github.com/neovim/neovim/commit/396a3945c4eba733b3a99a7ded217af83a400791#r34642361
* | f_environ: cleanup/refactorDaniel Hahler2019-08-06
| | | | | | | | | | - use os_getenvname_at_index / os_getenv - f_getenv: empty (*p == NUL) is not null (undefined)
* | env: invalid pointer after os_setenv() #10558erw72019-07-23
|/
* vim-patch:8.1.0211: expanding a file name "~" results in $HOMEJan Edmund Lazo2019-05-25
| | | | | | Problem: Expanding a file name "~" results in $HOME. (Aidan Shafran) Solution: Change "~" to "./~" before expanding. (closes vim/vim#3072) https://github.com/vim/vim/commit/00136dc321586800986e8f743c2f108f5eecbf92
* Merge #9686 'win/Lua: monkey-patch os.getenv()'Justin M. Keyes2019-03-16
|\ | | | | | | fixes #9681
| * Fix environment variable on Windowserw72019-03-06
|/ | | | | | | Since uv_os_setenv uses SetEnvironmentVariableW, _wenviron is no updated. As a result, inconsistency occurs in completion of environment variable names. Change to use GetEnvironmentStaringsW instead of _wenviron to solve it.
* os/env: Fix completion of multibyte env var nameserw72019-03-03
| | | | fixes #9655
* os/env: use libuv v1.12 getenv/setenv APIJustin M. Keyes2019-02-27
| | | | | | | | | | | - Minimum required libuv is now v1.12 - Because `uv_os_getenv` requires allocating, we must manage a map (`envmap` in `env.c`) to maintain the old behavior of `os_getenv` . - free() map-items after removal. khash.h does not make copies of anything, so even its keys must be memory-managed by the caller. closes #8398 closes #9267
* os_getenv, os_setenv: revert "widechar" implJustin M. Keyes2019-02-26
| | | | | | | | | | It's reported that the Windows widechar variants do automatically convert from the current codepage to UTF16, which is very helpful. So the "widechar" impls are a good direction. But libuv v1.12 does that for us, so the next commit will use that instead. ref #8398 ref #9267
* win: os_getenv(): use _wgetenv()Justin M. Keyes2019-02-25
|
* os_setenv: use _wputenv_s; remove vestigial code #7920Justin M. Keyes2019-02-25
| | | | | _putenv_s variant was left over from 810d31a43001, should have been removed in cd5b1315757e.
* Merge #9401 from justinmk/pr-win-erw7Justin M. Keyes2018-12-30
|\