ridiculousfish
87b7b6b2bb
Make control-S begin navigating the pager contents
...
In addition to showing the search field, actually allow the user to type in
it.
2019-01-22 14:41:13 -08:00
ridiculousfish
91a9c98974
Correctly inherit a virtual PWD
...
PWD is not set in fish vars because it is read only.
Use getenv() to fetch it, allowing fish to inherit a virtual PWD.
Fixes #5525
2019-01-22 13:34:04 -08:00
Fabian Homborg
82b4d7225c
env_get_runtime_path: Check for getpwuid() failure
...
Otherwise this is a NULL dereference and then crash.
Fixes #5550 .
2019-01-22 19:30:04 +01:00
Mahmoud Al-Qudsi
0edaf42d10
Fix regression for #4178 and others introduced by 364c839
...
...while still keeping intact the fix for #5519 .
2019-01-21 20:29:31 -06:00
Mahmoud Al-Qudsi
462cb6044c
Use standard __CYGWIN__ define for Cygwin detection
2019-01-21 20:06:16 -06:00
ridiculousfish
3cc581fbb0
Unconditionally set the tty mode in reader_readline
...
There was a bogus check for is_interactive_session. But if we are in
reader_readline we are necessarily interactive (even if we are not in
an interactive session, i.e. a fish script invoked some interactive
functionality).
Remove this check.
Fixes #5519
2019-01-20 17:36:31 -08:00
ridiculousfish
1680b741b2
Make while loops evaluate to the last executed command status
...
A while loop now evaluates to the last executed command in the body, or
zero if the loop body is empty. This matches POSIX semantics.
Add a bunch of tricky tests.
See #4982
2019-01-20 16:37:20 -08:00
ridiculousfish
fec10830d3
Correctly handle exited jobs in process_mark_finished_children
...
This is effectively a pick of 2ebdcf82ee
and the subsequent fixup. However we also avoid setting WNOHANG unless
waitpid() indicates a process was reaped.
Fixes #5438
2019-01-20 15:07:08 -08:00
ridiculousfish
2a190c6f3b
exec to only warn on background jobs in interactive sessions
...
Extension of fix for #5449 in b007248
2019-01-20 13:53:11 -08:00
Fabian Homborg
c66b3128ec
Use wcstod_l on NetBSD
...
It has wcstod_l, but not uselocale, so we can't use the fallback.
2019-01-20 18:35:38 +01:00
ridiculousfish
b1f5cb9bf4
Revert "Revert "Fix unsafe locale usage in wcstod_l
fallback""
...
This reverts commit c15a702f18
.
The tests are no longer broken after rerunning CMake.
2019-01-19 13:27:28 -08:00
Fabian Homborg
3847d2e9d1
Also set the read-only flag for non-electric vars
...
For some reason, we have two places where a variable can be read-only:
- By key in env.cpp:is_read_only(), which is checked via set*
- By flag on the actual env_var_t, which is checked e.g. in
parse_execution
The latter didn't happen for non-electric variables like hostname,
because they used the default constructor, because they were
constructed via operator[] (or some such C++-iness).
This caused for-loops to crash on an assert if they used a
non-electric read-only var like $hostname or $SHLVL.
Instead, we explicitly set the flag.
We might want to remove one of the two read-only checks, or something?
Fixes #5548 .
2019-01-18 19:27:41 +01:00
Dan Zimmerman
857561ca14
Fix warnings when compiling on macos
...
These warnings were appearing and annoying me so Im making a PR to fix
them.
2019-01-17 13:56:17 -06:00
Fabian Homborg
58b696bed1
complete: Don't allow wrapping a command with itself
...
Double-fixes #5541 , by not allowing it to happen.
2019-01-17 09:49:50 +01:00
Mahmoud Al-Qudsi
dd31933c09
Remove spurious initialization in profiling_cmd_name_for_redirectable_block
2019-01-16 15:48:25 -06:00
Mahmoud Al-Qudsi
20cdcfadac
Remove write-only assignments from autload.cpp
2019-01-16 15:46:11 -06:00
Mahmoud Al-Qudsi
53355885c8
Clean up dead code in builtin_read.cpp
2019-01-16 15:44:10 -06:00
Mahmoud Al-Qudsi
333bf1fd9f
Remove write-only desc_width
local variable
2019-01-16 15:38:27 -06:00
Mahmoud Al-Qudsi
bad3c5d79d
Remove dead assignment and clarify ENV_NOT_FOUND behavior for set -e
2019-01-16 15:27:23 -06:00
Aaron Gyes
2abd0cde85
builtin_printf.cpp: remove is_hex_digit, redo is_octal_digit
...
Our is_hex_digit() was redundant, we can just use iswxdigit; the libc
implementation is a more efficient table lookup anyhow.
Do is_octal_digit() in terms of iswdigit instead of using wcschr.
2019-01-15 02:05:12 -08:00
Mahmoud Al-Qudsi
027fc43736
Fix result after explicit return
in a while
block
...
Closes #5513 .
2019-01-13 18:56:19 -06:00
ridiculousfish
2d3e8ec0a9
Correct highlighting of abbreviations
...
Abbreviation highlighting cannot use the snapshot environment because we do
not know up-front which variables to capture. Will revisit this later.
2019-01-11 20:43:52 -08:00
ridiculousfish
82170b0862
Add HOME as a snapshotted variable
...
Corrects certain autosuggestions involving tildes.
2019-01-11 15:12:17 -08:00
ridiculousfish
59d62fdd53
Thread the right PWD through autosuggestions
...
These were getting / as the PWD, resulting in bogus suggestions.
2019-01-11 15:04:09 -08:00
ridiculousfish
a333c2f01d
Fix some compile warnings
2019-01-10 20:59:47 -08:00
ridiculousfish
77884bc21a
Instantize env_get
...
This removes env_get(). All fish variable accesses must go through an
environment_t.
2019-01-10 20:08:06 -08:00
ridiculousfish
b98812dd1a
Remove last vestiges of env_set
2019-01-10 20:07:58 -08:00
ridiculousfish
3b1709180f
Instantize env_get
2019-01-10 20:07:53 -08:00
ridiculousfish
6f52e6bb1c
Instantize contents of exec.cpp and others
2019-01-10 20:07:47 -08:00
ridiculousfish
038f3cca6d
Remove the abbreviation cache
...
Read abbreviations directly from the environment.
2019-01-10 20:07:41 -08:00
ridiculousfish
9f62a53077
Instantize env_get inside highlighting
2019-01-10 20:07:35 -08:00
ridiculousfish
50c83463f1
Switch some uses of env_get to instanced environment_t
2019-01-10 20:07:31 -08:00
ridiculousfish
3eb15109cf
Instantize env_set in env.h and env.cpp
2019-01-10 20:07:23 -08:00
ridiculousfish
abcd24f716
Eliminate env_snapshot_t::current()
...
These uses are better served by passing in the real environment stack,
now that we have environment_t as a shared base class.
2019-01-10 20:07:14 -08:00
ridiculousfish
03b92ffe00
Clean up path_get_cdpath and path_can_be_implicit_cd
2019-01-10 20:07:10 -08:00
ridiculousfish
c1dd284b3e
Instantize env_set
...
Switch env_set to an instance method on environmnet_t.
2019-01-10 20:05:45 -08:00
ridiculousfish
421fbdd52a
Instantize env_get_pwd_slash
...
This requires threading environment_t through many places, such as completions
and history. We introduce null_environment_t for when the environment isn't
important.
2019-01-10 20:01:28 -08:00
ridiculousfish
26fc705c07
Instance env_set_empty
2019-01-10 20:01:20 -08:00
ridiculousfish
a00de96a57
Instance env_remove
2019-01-10 20:01:15 -08:00
ridiculousfish
ede66ccaac
Instance env_set_argv and env_set_pwd
2019-01-10 20:29:10 -08:00
ridiculousfish
5055621e02
Eliminate env_push and env_pop
2019-01-10 20:29:10 -08:00
ridiculousfish
94adb53b1f
Eliminate complete_set_variable_names
2019-01-10 20:29:10 -08:00
ridiculousfish
e6b13c6bac
Begin to thread environments explicitly through completions
2019-01-10 20:29:10 -08:00
ridiculousfish
e6872b83b0
Eliminate global env_export_arr()
...
This assumes the set of exported variables is a global property; but we
want it to be a local property.
2019-01-10 20:29:10 -08:00
ridiculousfish
a47f6859bd
Equip parser_t with a variable stack
...
Prepares to eliminate env_get and env_set by accessing variables through
a parser.
2019-01-10 20:29:10 -08:00
ridiculousfish
bba66a3ecc
Use shared_ptr instead of unique_ptr in environments
...
This prepares for multiple environment stacks sharing the same parent.
2019-01-10 20:29:10 -08:00
ridiculousfish
8d7cae63ff
Introduce env_stack_t
...
This will instance environment variable stacks.
2019-01-10 20:29:10 -08:00
ridiculousfish
391af6af0c
Introduce class environment_t
...
This will be used as a base class for variable snapshots and variable stacks.
2019-01-10 20:29:10 -08:00
ridiculousfish
895c2c4af0
Minor cleanup of parser interface
2019-01-10 20:29:10 -08:00
Mahmoud Al-Qudsi
2bb53f7253
Fix locale_t
under macOS 10.10
...
`xlocale.h` is not available on Linux, so we can't just universally
include it.
`HAVE_XLOCALE_H` was already being tested/set in the CMake script as a
possible requirement for `wcstod_l` support, this just adds it to
`config_cmake_h.in` and uses it in `wutil.h` to gate the include.
2019-01-10 20:03:38 -06:00