Commit Graph

1680 Commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
3b210cc5bd Do not audibly complain on EINTR in waitpid call 2018-10-29 14:22:46 -05:00
Mahmoud Al-Qudsi
132edda6ff Block on fg processes even if not under job control
Closes #5292.
2018-10-29 04:45:47 +00:00
ridiculousfish
fd13043340 Rename select_try_t::IO_ERROR to select_try_t::IOCHAIN_EMPTY
select_try() returned IO_ERROR to indicate that there's no file descriptors
from which to read. Name this return value properly.

Also migrate this type into proc.cpp since it's not used outside of the
header.
2018-10-28 17:14:25 -07:00
ridiculousfish
03ec48c701 Turn the select_try_t into a switch statement
This allows the compiler to warn about missing cases.
2018-10-28 17:12:01 -07:00
ridiculousfish
bf089addd0 Restyle proc.cpp 2018-10-28 17:09:57 -07:00
Mahmoud Al-Qudsi
a2dda29cf6 Fix build on macOS Yosemite
Older versions of the macOS dev toolchain use MAP_ANON instead of
MAP_ANONYMOUS. We already do this elsewhere.
2018-10-28 12:48:27 -05:00
Mahmoud Al-Qudsi
203de775d0 Fix hang when piping from function to process and exceeding pipe buffer
This is an opposite case from the usual "pipe into grep-the-function"
where my `pbpaste` emitted a lot of content exceeding the OS pipe
buffer. The `block_on_fg` condition was just `send_sigcont` in the
original job control rewrite, and it was incorrect to sub it for
WAIT_BY_PROCESS on its own.

However, this requires always blocking when select_try returns an
interrupted/incomplete read or else fish doesn't block and stays running
in a tight loop in the background (and incorrectly writing to a terminal
it doesn't own under higher debug levels), which I *think* is OK.
2018-10-28 10:35:51 -05:00
Mahmoud Al-Qudsi
1015e74480 Treat _ and - alike for case-insensitive fuzzy matching
Closes #3584.
2018-10-28 10:35:32 -05:00
Mahmoud Al-Qudsi
17049ce919 Reuse std::locale() across calls within single ifind()
Instantiate the std:locale instance used within the character comparison
callback outside the lambda and take a reference to it instead of
creating the locale object for each character in the sequence.

This is part of a very tight loop with lots of inputs during the
evaluation of fuzzy string matches for completions/autosuggestions and
is worth optimizing.
2018-10-27 18:51:59 -05:00
Mahmoud Al-Qudsi
0d8334a31b Fix hup_background_jobs (née kill_background_jobs) implementation
This was introduced in 1b1bc28c0a but did
not cause any problems until the job control refactor, which caused it
to attempt to signal the calling `exec` builtin's own (invalid) pgrp
with SIGHUP.

Also improved debugging for `j->signal()` failures by printing the
signal we tried sending in case of error, rename the function to
`hup_background_jobs`, and move it from `reader.h`/`reader.cpp` to
`proc.h`/`proc.cpp`.
2018-10-27 18:01:38 -05:00
Mahmoud Al-Qudsi
4d3b56c151 Associate external commands in functions with extant pgrps
When a function is encountered by exec_job, a new context is created for
its execution from the ground up, with a new job and all, ultimately
resulting in a recursive call to exec_job from the same (main) thread.

Since each time exec_job encounters a new job with external commands
that needs terminal control it creates a new pgrp and gives it control
of the terminal (tcsetpgrp & co), this effectively takes control away
from the previously spawned external commands which may be (and likely
are) expecting to still have terminal access.

This commit attempts to detect when such a situation arises by handling
recursive calls to exec_job (which can only happen if the pipeline
included a function) by borrowing the pgrp from the (necessarily still
active) parent job and spawning new external commands into it.

When a parent job spawns new jobs due to the evaluation of a new
function (which shouldn't be the case in the first place), we end up
with two distinct jobs sharing one pgrp (to fix #3952). This can lead to
early termination of a pgrp if finished parent job children are reaped
before future processes in either the parent or future child jobs can
join it.

While the parent job is under construction, require that waitpid(2)
calls for the child job be done by process id and not job pgrp.

Closes #3952.
2018-10-27 18:01:38 -05:00
Mahmoud Al-Qudsi
419d7a5138 Don't decompose shared_ptr to raw pointer for exec_job 2018-10-27 18:01:38 -05:00
Mahmoud Al-Qudsi
008eef50f3 Speed up process_mark_finished_children calls
Use SIGCHLD to determine whether or not waitpid(2) calls can be elided,
but only with extreme caution. If we receive SIGCHLD but are not able to
reap all jobs, we need to iterate through them again.

For this to work, we need to make sure that we reap all children that we
can reap after a SIGCHLD, i.e. it's not OK to just reap the first and
return or else we can never clear the dirty state flag.

In all cases, as expensive as a call to waitpid() may be, if a child
process is available for reaping it is always cheaper to wait on it then
reap it than to call select_try() and end up timing out.
2018-10-27 18:01:38 -05:00
Mahmoud Al-Qudsi
c7f5e58927 More graceful handling of setpgid(2) failure in child_set_group()
Handle EPERM (WSL only?) and EINTR by retrying.
2018-10-27 18:01:38 -05:00
Mahmoud Al-Qudsi
3afcca3114 Drop keepalive process even for WSL
Windows 10 17763 Redstone 5 (October 2018 Update) officially brings
zombie support (first introduced in 17713) to the general public.

See https://docs.microsoft.com/en-us/windows/wsl/release-notes#build-17763-1809
2018-10-27 18:01:38 -05:00
Mahmoud Al-Qudsi
319d1b81fb Add note about PROCESS_EXIT still being used 2018-10-27 18:01:38 -05:00
Mahmoud Al-Qudsi
8072900e16 Change control flow in job_continue()
The old code was rather haphazard with regards to error control, and
would make mutable changes before operations that could fail without any
viable error handling options.
2018-10-27 18:01:38 -05:00
Mahmoud Al-Qudsi
39a05a359a Overhaul continue_job() and try_select()
Convert `select_try()` to return a well-defined enum describing its
state, and handle each of the three possible cases with clear reasons
why we are blocking or not blocking in each subsequent call to
`process_mark_finished_children()`.
2018-10-27 18:01:38 -05:00
Mahmoud Al-Qudsi
1bfbed94ae Clean up terminal_give_to_job()
* Use the newly-introduced signal_block_t RAII wrapper
* Remove EINTR loops as all signals are blocked
* Clean up control flow thanks to RAII wrappers
* Rename parameter to clarify what it does and update docs accordingly
* Update outdated comments referencing SIGSTOP code that was removed a
  long time ago.
* Remove no-op CHECK_BLOCK() call
2018-10-27 18:01:38 -05:00
Mahmoud Al-Qudsi
bd122aa433 Add RAII wrapper for signal_block/signal_unblock 2018-10-27 18:01:38 -05:00
Mahmoud Al-Qudsi
f9118d964e Clean up job flags, status helpers, and instance helper methods
* Convert JOB_* enums to scoped enums
* Convert standalone job_is_* functions to member functions
* Convert standalone job_{promote, signal, continue} to member functions
* Convert standolen job_get{,_from_pid} to `job_t` static functions
* Reduce usage of JOB_* enums outside of proc.cpp by using new
  `job_t::is_foo()` const helper methods instead.

This patch is only a refactor and should not change any functionality or
behavior (both observed and unobserved).
2018-10-27 18:01:38 -05:00
Mahmoud Al-Qudsi
e753581df7 Bring some consistency and rationale to debug log levels
* Debug level 3: describe all commands being executed (this is, after all,
a shell and one can argue that this is the most important debug
information avaliable)
* Debug level 4: details of execution, mainly fork vs no-fork and io
handling

Also introduced j->preview() to print a short descriptor of the job
based on the head of the first process so we don't overwhelm with
needless repitition, but also so that we don't have to rely on
distinguishing between repeated, non-unique/non-monotonic job ids that
are often recycled within a single "execution cycle" (pressing enter
once).
2018-10-27 18:01:38 -05:00
Mahmoud Al-Qudsi
0ff24b35a1 Overhaul behavior of process_mark_finished_children()
Per @ridiculousfish's suggestions in #5219,
`process_mark_finished_children()` has been updated to work in an easier-
to-follow manner. Its behavior is now straight forward, it always checks
for finished processes but only blocks if `block_on_fg` is true.

We're not using the SIGCHLD count in s_sigchld_generation_cnt for
anything any more, as it's not actually a reliable metric since we can
experience one SIGCHLD as a result of two processes exiting (see #1768),
but only reap one of them if the other is in a not-fully-constructed job
(see #5219), a state we cannot possibly detect without calling
`waitpid()` on all child processes, which we are explicitly avoiding.
2018-10-27 18:01:38 -05:00
Mahmoud Al-Qudsi
54050bd4c5 Convert job list to a dequeue
We never insert elements into the middle of a job list, only move
elements to the top. While that can be done "efficiently" with a list, it
can be done faster with a deque, which also won't thrash the cache when
enumerating over jobs.

This speeds up enumeration in the critical path in
`process_mark_finished_children()`.
2018-10-27 18:01:38 -05:00
Mahmoud Al-Qudsi
d467bb58d9 Replace pid/pgid -2 with INVALID_PID 2018-10-27 18:01:38 -05:00
Mahmoud Al-Qudsi
af0c8d51e0 Overhaul job and terminal control
* Instead of reaping all child processes when we receive a SIGCHLD, try
reaping only processes belonging to process groups from fully-
constructed jobs, which should eliminate the need for the keepalive
process entirely (WSL's lack of zombies not withstanding) as now
completed processes are not reaped until the job has been fully
constructed (i.e.  all processes launched), which means their process
group should still be around for new processes to join.

* When `tcgetpgrp()` calls return 0, attempt to `tcsetpgrp()` before
invoking failure handling code.

* When forking a builtin and not running interactively, do not bail if
unable to set/restore terminal attributes.

Fixes #4178. Fixes #3805. Fixes #5210.
2018-10-27 18:01:38 -05:00
ridiculousfish
9454397e4c Correctly split path environment variables about colons
As noted in #5271
2018-10-27 15:20:32 -07:00
ridiculousfish
47890389e1 Merge branch 'uvar_path_support'
Support for --path and --unpath in universal variables.
Closes  #5271
2018-10-27 01:24:27 -07:00
ridiculousfish
5899694233 Allow setting universal path variables
Support for path and unpath in universal variables.
Fixes #5271
2018-10-27 01:05:00 -07:00
ridiculousfish
9690ac5974 Rename fish_universal_variables file to fish_variables
This is to avoid development versions of fish 3.0 freaking out when the
file format is changed. We now have better support for for future universal
variable formats so it's unlikely we'll have to change the file name again.
2018-10-26 16:06:50 -07:00
ridiculousfish
7b5296817a Teach universal variables to not overwrite future file formats 2018-10-26 16:06:50 -07:00
ridiculousfish
d18e2d970c Switch to new universal variable format
Example line:

SETUVAR --export foo:bar
2018-10-26 16:06:50 -07:00
ridiculousfish
11c77abc8c Make universal variable matching case sensitive 2018-10-26 16:06:50 -07:00
ridiculousfish
fe485f2485 Adopt populate_varabless in universal variables 2018-10-26 16:06:50 -07:00
ridiculousfish
adc69f94da Support parsing the new universal variable format 2018-10-26 16:06:50 -07:00
ridiculousfish
d98874bd08 Improve testability factoring of env_universal_t 2018-10-26 16:06:47 -07:00
Mahmoud Al-Qudsi
ebb3a3a16e Set $fish_private_mode and show a message on private mode startup
The message can be localized and is set as a global variable shadowing
the universally-defined $fish_greeting.
2018-10-24 19:33:48 +02:00
Mahmoud Al-Qudsi
379f44fabe Add a --private option to launch fish in private mode
In private mode, access to previous history is blocked and new history
does not persist and is only available for the duration of the current
session.

This mode can be used when it is not desirable for commandline history
to leak into a session, e.g. via autocomplete or when it is desirable to
test the behavior of fish in the absence of history items without
permanently clearing the history.

I'm sure there are a lot more features that can be incorporated into
private mode, such as restricting access to certain user-specific
configuration files, etc.

This addresses a lot of the concerns raised in #1363 (which was later
changed to track mosh-specific problems). See also #102.
2018-10-24 19:33:48 +02:00
Fabian Homborg
afc82ff23e Math: Truncate integers (scale == 0)
Fixes #5251.
2018-10-24 18:53:33 +02:00
Fabian Homborg
c5d72332ba io: Explicitly reset discard flag
When we discard output because there's been too much, we print a
warning, but subsequent uses of the same buffer still discard.

Now we explicitly reset the flag, so we warn once and everything works
normal after.

Fixes #5267.
2018-10-24 16:59:24 +02:00
Fabian Homborg
6bc2e15953 reader: Stringify completion_apply_to_command_line 2018-10-24 11:28:55 +02:00
Fabian Homborg
410e13dd74 expand: Stringify get_home_directory_name
This is actually nicer than the pointilistic version.
2018-10-23 19:10:14 +02:00
Fabian Homborg
884b4c9a61 parse_util: Remove some wcharisms 2018-10-23 19:10:14 +02:00
Fabian Homborg
f64a87a374 path: Make working_directory wcstring
Kinda weird that that one was a wchar_t*
2018-10-23 19:10:14 +02:00
Fabian Homborg
7533fa89d4 complete: Stringify 2018-10-23 19:10:14 +02:00
Fabian Homborg
d727e32934 __fish_print_help: Just use $COLUMNS
This had an undocumented internal feature that would pass the tty
width along. Instead, just have it read $COLUMNS, which we always
define anyway.
2018-10-23 15:05:15 +02:00
Fabian Homborg
1d5e715008 source: Return error instead of implicitly reading from tty
For things like

    source $undefined

or
    source (nooutput)

it was quite annoying that it read from tty.

Instead we now require a "-" as the filename to read from the tty.

This does not apply to reading from stdin if it's redirected, so

    something | source

still works.

Fixes #2633.
2018-10-22 21:22:27 +02:00
ridiculousfish
11d523e61a Build out support for multiple file formats in uvars
This is in preparation for adjusting the file format to support path
variables.
2018-10-21 15:56:05 -07:00
ridiculousfish
ce1463bde6 Add line_iterator_t
Adds support for splitting a collection into lines.
2018-10-21 15:56:05 -07:00
ridiculousfish
a23894ca37 Simplify callback_data_t
SET_EXPORT no longer makes sense; remove it.
2018-10-21 15:56:05 -07:00
ridiculousfish
ac241b7132 Simplify and add tests for ifind 2018-10-21 15:53:58 -07:00
ridiculousfish
fcd4a44b98 Correct check and add a basic test for fuzzy_match_substring_case_insensitive 2018-10-21 12:02:38 -07:00
ridiculousfish
00b1dd861e Merge branch 'splitenv_1.8'
This merges support for PATH variables. Closes #5245
2018-10-20 12:51:51 -07:00
Fabian Homborg
6eccf6557f common: Pass in length for wcs2str with wcstring
Removes _two_ wcslen calls.
2018-10-20 20:52:02 +02:00
Fabian Homborg
d4db4f40a4 Remove another unnecessary wcstring->wchar conversion 2018-10-20 20:52:02 +02:00
Fabian Homborg
27c0ee92de Remove a few useless .c_str()
With .c_str(), these call the wchar_t* overloads, which frequently then go on to call wcslen.
Just directly use the wcstring we already have.
2018-10-20 20:51:05 +02:00
ridiculousfish
f4d666f56c Allow user to set and unset path property of variables
This adds flags --path and --unpath to builtin set, analogous to
--export and --unexport. These flags change whether a variable is
marked as a path variable.

Universal variables cannot yet be path variables.
2018-10-19 17:39:21 -07:00
ridiculousfish
5947aa0171 Join variables by their delimiter in quoted expansion
This switches quoted expansion like "$foo" to use foo's delimiter instead of
space. The delimiter is space for normal variables and colonf or path variables.
Expansions like "$PATH" will now expand using ':'.
2018-10-19 17:35:36 -07:00
ridiculousfish
3f3b3a7006 Export arrays as colon delimited, and support path-style variables
This commit begins to bake in a notion of path-style variables.

Prior to this fix, fish would export arrays as ASCII record separator
delimited, except for a whitelist (PATH, CDPATH, MANPATH). This is
surprising and awkward for other programs to deal with, and there's no way
to get similar behavior for other variables like GOPATH or LD_LIBRARY_PATH.

This commit does the following:

1. Exports all arrays as colon delimited strings, instead of RS.

2. Introduces a notion of "path variable." A path variable will be
"colon-delimited" which means it gets colon-separated in quoted expansion,
and automatically splits on colons. In this commit we only do the exporting
part.

Colons are not escaped in exporting; this is deliberate to support uses
like

    `set -x PYTHONPATH "/foo:/bar"`

which ought to work (and already do, we don't want  to make a compat break
here).
2018-10-19 17:29:39 -07:00
ridiculousfish
5fa4e0d2ee Highlight %self as an operator 2018-10-19 16:17:30 -07:00
ridiculousfish
d73c487d60 Restore %self to refer to the fish pid
This brings back the %self argument. Like the original %self it only expands
if the argument is literally %self.
2018-10-19 16:17:25 -07:00
Mahmoud Al-Qudsi
6df29b2fd1 Revert "Disable ONLCR mapping of NL output to CR-NL"
This reverts commit 3f820f0edf.
While the premise described by @nbuwe is sound in #4505, we are now
apparently relying on this behavior is some places (although
inadvertently as there doesn't seem to be a deliberate acknowledgement
of that anywhere).

Turning off ONLCR causes things like indented multiline commands to not
appear correct at the tty (subsequent lines appear both at column 0 and
again indented).
2018-10-19 17:49:11 -05:00
Mahmoud Al-Qudsi
3f820f0edf Disable ONLCR mapping of NL output to CR-NL
Per @nbuwe's excellent explanation in #4505, we can save on output
to the tty by maintaining column location after NL by disabling the
ONLCR terminal mode.

Closes #4505.
2018-10-17 21:20:39 -05:00
Mahmoud Al-Qudsi
dfe6bc531e Enable case-insensitive substring fuzzy matching
Adds a new match mode for `string_fuzzy_match_t` that matches against a
case-insensitive subsequence within a string, e.g. `LL` now (partially)
matches against `hello`. This is implemented as a separate mode, given a
lower priority of match than a same-case match (when present).

Note that `fuzzy_match_subsequence_insertions_only` has purposely not
been extended with a case-insensitive version as that would be a)
unlikely to match often, and b) adding a second inefficient fuzzy search
to something that's queried a lot. Perhaps `subsequence_insertions_only`
can simply be changed to be a case-insensitive comparison in the future?

Closes #1196. Affects #3978.
2018-10-16 21:45:04 -05:00
Mahmoud Al-Qudsi
bb829075d8 Add case-insensitive string/wcstring search 2018-10-16 21:42:55 -05:00
Mahmoud Al-Qudsi
259135b211 fixup! Simplify wildcard_complete prototype
Fix broken build under clang 8.0 under Linux.
2018-10-16 20:38:46 -05:00
ridiculousfish
202bf0bede Tab complete abbreviations
This allows abbreviations to be expanded by tab completions.

Fixes #3233
2018-10-16 16:15:27 -07:00
ridiculousfish
161196fe53 Simplify wildcard_complete prototype
Rather than accepting both a 'description' and a 'description function',
accept just the description function.
2018-10-16 15:43:42 -07:00
Mahmoud Al-Qudsi
0e62dedb26 Correct misdetection of [001] as literal zero index
The control flow in expand.cpp is a bit more complicated than it seemed
at first blush. Ref #4862.
2018-10-15 14:11:37 -05:00
Mahmoud Al-Qudsi
6bc59db721 Detect when running out of cmake build directory
Load fish docs and configuration out of the source and/or build
directories rather from the installed paths when running directly out
of the cmake build directory.

Closes #5255.
2018-10-13 21:48:28 -05:00
ridiculousfish
f212518d3e Allow SIGINT in non-interactive mode
Prior to this fix, fish would swallow SIGINT in non-interactive mode. This
meant that scripts could only be Ctrl-C'd if fish was executing an external
command.

Unblock SIGINT in non-interactive mode.

Fixes #5253
2018-10-12 23:58:14 -07:00
ridiculousfish
c76de58758 Normalize "/" path to "/"
This is one obnoxious function.

Fixes #5250
2018-10-12 22:15:16 -07:00
Mahmoud Al-Qudsi
8c3481a921 Block the history race test from running under WSL
It's always failing, and the current test scripts refuse to progress
after the first failure, making it impossible to test fish under WSL.
2018-10-11 18:54:32 -05:00
ridiculousfish
e363171b8d Switch from strdup to std::string in fish_tests 2018-10-11 09:58:16 -07:00
ridiculousfish
90d89a3262 Use more move constructors in expansion
Reduce allocations by switching to move semantics.
clang-tidy detects some use-after-moves.
2018-10-11 02:03:28 -07:00
ridiculousfish
4c08cbd050 Mark completion move ctor as noexcept
Move constructors aren't used unless we mark this ctor as noexcept.
2018-10-11 02:02:55 -07:00
Mahmoud Al-Qudsi
1f0085bc08 fixup! Add status fish-path
Fixes broken macOS build. I'm not sure how the code used to compile
without including `dyld.h` previously, perhaps a different header used
to pull it in?
2018-10-10 00:29:45 -05:00
Mahmoud Al-Qudsi
e212269ab1 Add status fish-path
Retrieves the fully resolved path to the currently executing fish binary
(regardless of PATH). Can be used to ensure that the same fish is
launched again from a script.

`get_executable_path()` moved from fish binary to libfish, also cleaned
up some duplicated (but differing!) definitions of PATH_MAX (which was
used by that function) in the process.
2018-10-09 22:34:41 -05:00
Mahmoud Al-Qudsi
c6230ddfde Clean up status_builtin options and enums
Drop usage of magic numbers and sort lists where possible.
2018-10-09 22:14:42 -05:00
Mahmoud Al-Qudsi
236556ba05 Update get_executable_path() for FreeBSD
Remove dependency on the Linux compatibility layer's procfs being
installed and mounted when running under FreeBSD by directly querying
the MIB for the path to the running fish executable
(KERN_PROC_PATHNAME). Tested under FreeBSD 11.2-RELEASE.
2018-10-09 19:47:49 -05:00
ridiculousfish
0f0bb1e10f Don't resolve symlinks with cd
This switches fish to a "virtual" PWD, where it no longer uses getcwd to
discover its PWD but instead synthesizes it based on normalizing cd against
the $PWD variable.

Both pwd and $PWD contain the virtual path. pwd is taught about -P to
return the physical path, and -L the logical path (which is the default).

Fixes #3350
2018-10-06 17:03:18 -07:00
ridiculousfish
6ad4d94e12 Introduce path_normalize
This new function performs normalization of paths including dropping
/./ segments, and resolving /../ segments, in preparation for switching
fish to a "virtual" PWD.
2018-10-06 17:03:18 -07:00
ridiculousfish
767b7a2180 Migrate the completion set to owning_lock_t 2018-10-05 09:05:59 -07:00
Mahmoud Al-Qudsi
3875cc60bd Optimize literal_zero_index comparisons
No longer check literal zero after the first non-zero value.
2018-10-01 21:20:13 -05:00
Mahmoud Al-Qudsi
264d8270a7 Emit an error message on literal zero indices
Mostly resolves #4862, though there remains the lingering question of
whether or not to emit a warning to /dev/tty or stderr when a
non-literal-zero index evaluates to zero.
2018-10-01 20:58:26 -05:00
Mahmoud Al-Qudsi
e04130e145 fixup! Add overload of wcstringutil::trim that automatically trims whitespace 2018-10-01 17:22:40 -05:00
Mahmoud Al-Qudsi
f702c42068 Sanitize history item whitespace
Coalesces commands with leading (if even possible) and trailing
whitespace into the same item, improving the experience when iterating
over history entries.

Closes #4908.
2018-10-01 17:12:18 -05:00
Mahmoud Al-Qudsi
a9845dc026 Add overload of wcstringutil::trim that automatically trims whitespace 2018-10-01 17:12:18 -05:00
ridiculousfish
d7cbf3581d Remove retval global from builtin_wait 2018-10-01 09:59:27 -07:00
ridiculousfish
1bc4cf2318 More const and atomic correctness 2018-10-01 09:59:22 -07:00
ridiculousfish
070a43989f Mark a null variable const in builtin_echo 2018-10-01 09:47:45 -07:00
ridiculousfish
a722a4b967 Remove global variables from builtin_commandline
There was no reason to have builtin_commandline store its buffer in a global,
these can be local variables.
2018-10-01 09:34:58 -07:00
ridiculousfish
5735703261 Convert some static wcstring_list_t to C arrays
Saves some allocations at startup.
2018-09-30 19:57:05 -04:00
ridiculousfish
e6d09dc4fe Remove another unnecessary env_var_t creation 2018-09-30 18:30:13 -04:00
ridiculousfish
bd7fea55c4 Remove some unnecessary env_var_t usage 2018-09-30 18:20:59 -04:00
ridiculousfish
6147e9ee0d path_get_cdpath to accept string instead of env_var_t
Unclear why it ever needed an env_var_t. wcstring is sufficient and much
simpler.
2018-09-30 18:13:14 -04:00
ridiculousfish
16da066722 Convert some loops in input.cpp 2018-09-30 18:13:14 -04:00
ridiculousfish
05d14f24d6 Fix a crash in bind
444f9f8715 introduced a bug where we would
use an iterator that had been invalidated by erase(). Fix that.
2018-09-30 18:00:52 -04:00
Fabian Homborg
444f9f8715 Add separation of "preset" bindings
This allows for marking certain bindings as part of a preset, which allows us to

- only erase those when switching presets
- go back to the preset binding when erasing a user binding
- only show user customization if requested
- make bare bind statements in config.fish work (!!!11elf!!!)

Fixes #5191.
Fixes #3699.
2018-09-30 16:54:56 +02:00
ridiculousfish
36a149337b Eliminate / vet and whitelist some more globals 2018-09-29 01:11:15 -04:00