Commit graph

4032 commits

Author SHA1 Message Date
ridiculousfish
5e60efefbf Allow parse_util_detect_errors to treat incomplete strings as errors
Fixes bug where sourcing a file with an unclosed quote would not have a
backtrace
2014-07-24 14:41:15 -07:00
ridiculousfish
f6a89d13c2 Merge branch 'master' of github.com:fish-shell/fish-shell 2014-07-23 22:27:37 -07:00
Siteshwar Vashisht
3e01dd955f Updated code to parse bindings in webconfig.py 2014-07-23 01:53:15 +05:30
adisbladis
27fa0ea9d7 "webconfig.py: Don't allow NoneType as buffer, fallback to bytes.
Fixes TypeErrors when using bindings tab"
2014-07-22 12:31:57 +02:00
Michishige Kaito
2de914d8c3 Select the 4th line of output, instead of the second to last line 2014-07-16 18:22:27 +01:00
Michishige Kaito
616fa85458 Add grunt completion 2014-07-16 16:53:18 +01:00
ridiculousfish
20ad496c00 Merge pull request #1559 from davidxia/add-vi-mode-docs-fixes
Fix minor syntax and capitalization mistakes in vi mode docs
2014-07-15 19:05:03 -07:00
David Xia
fa88c42cf1 Fix minor syntax and capitalization mistakes in vi mode docs 2014-07-15 21:59:08 -04:00
David Xia
e84a762171 Add docs for vi mode
fixes #1536
2014-07-15 21:29:02 -04:00
Kevin Ballard
62d86b3d18 Fix documentation on variable scopes for read
The `read` docs incorrectly asserted that -g was the default for
variables. In actuality it behaves the same way that `set` does.
2014-07-14 09:12:00 +08:00
xzfc
4bbbd2dde6 Fix segfault in status builtin 2014-07-14 09:07:35 +08:00
David Adam
b884117a9e Makefile: just build key_reader with the same objs as fish 2014-07-14 09:06:40 +08:00
ridiculousfish
7def139020 Turn the 'mode' parameter of environment variables into an enum 2014-07-13 17:30:48 -07:00
ridiculousfish
b667eee351 Merge branch 'fix_set_scopes' of github.com:kballard/fish-shell into kballard-fix_set_scopes 2014-07-13 14:12:51 -07:00
ridiculousfish
891f55b2b3 Fix for crash in kill-whole-line
Fixes #1548
2014-07-13 14:06:35 -07:00
Kevin Ballard
7b12fd26f3 Change how we separate toplevel and global scopes
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.
2014-07-13 13:21:06 -07:00
Kevin Ballard
387ec5c06a set: Don't create empty var when erasing index
When using `set -e foo[1]` to erase an index, if the variable doesn't
already exist, return 1 instead of creating it as an empty variable.
2014-07-12 15:43:32 -07:00
Kevin Ballard
dcc043df3b Add an optional mode to env_get_string()
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.
2014-07-12 15:35:34 -07:00
Kevin Ballard
2457997cd9 set: Print an error when setting a special var in the wrong scope
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.
2014-07-12 14:07:55 -07:00
Kevin Ballard
d9bed68fe9 Mark COLUMNS/LINES as electric vars
They're dynamically calculated, so they qualify. This also removes them
from the list of exported global variables, because they're actually not
exported.
2014-07-12 14:07:55 -07:00
Kevin Ballard
2eb65b3625 set: Don't treat toplevel scope the same as global
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.
2014-07-12 14:07:55 -07:00
Kevin Ballard
76fdfe6890 Rewrite env_exists() for better scope handling
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.
2014-07-12 14:07:55 -07:00
ridiculousfish
495adee269 Don't sanity_lose if INTERNAL_BLOCK_NODEs have a null argv
Fixes #1545
2014-07-12 11:01:00 -07:00
Kevin Ballard
383aaa236e Don't allow readonly/electric values to come in through the env
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.
2014-07-12 00:53:23 -07:00
Kevin Ballard
8c89e6bce5 Fix typo and tweak set docs
Move the docs for the `-n` flag to `set` out of the list of scopes.
2014-07-12 00:21:04 -07:00
ridiculousfish
98297e5234 Teach while loops to not hang forever with no-execute
Fixes #1543
2014-07-11 11:28:10 -07:00
ridiculousfish
3915faf382 bind should not show -k for bindings that are escape sequences, not keys 2014-07-07 10:45:26 -07:00
ridiculousfish
d5fa4b2ccb Remove errant debug line 2014-07-07 02:01:43 -07:00
ridiculousfish
3ff104ba30 Rename lock_t to mutex_lock_t to fix Solaris compilation
Fixes #1510
2014-07-07 00:38:37 -07:00
Daniel J. Hofmann
706286c289 Fixes use-after-free issue.
Calling writer() might fail in which case launch_buff gets freed.
This patch prevents the subsequent use of memory after it was freed.
2014-07-06 20:54:19 -07:00
ridiculousfish
18c1b12741 Switch variable name in tests from foo to something less likely to be
used accidentally
2014-07-06 20:41:21 -07:00
ridiculousfish
5cda1e55e0 Must load universal variables earlier, and issue a barrier after erasing
one.

Fixes #1526
2014-07-06 18:12:18 -07:00
ridiculousfish
195cd130f8 Fix sense of test in parse_execution to issue a barrier if an external
command has run
2014-07-06 18:12:18 -07:00
ridiculousfish
b19f45e15d Add test for issue 1526 2014-07-06 18:12:18 -07:00
Maxim Gonchar
3acd0dfe48 Add dropbox completion 2014-07-06 20:40:53 +08:00
ridiculousfish
74cedbf1c5 Hopeful fix for Cygwin build (#1530) 2014-07-05 10:22:20 -07:00
Siteshwar Vashisht
7d47ec4c46 Properly handle invalid arguments in builtins
Fixes #1522
2014-07-02 17:04:58 +05:30
callesg
14cdd24f78 Added better build description closes #70
The stuff nedded to build on Ubuntu
2014-07-01 16:08:37 +02:00
David Adam
1cfd055f82 env.cpp: allow all users to change $USER and $HOME
Closes 1425 (https://github.com/fish-shell/fish-shell/issues/1425)
2014-06-28 19:16:29 +08:00
Sascha
ed5e585684 Also add forward/backward movement in insert mode 2014-06-27 22:55:27 +08:00
Sascha
32948b8dc6 Provide more useful insert mode mappings 2014-06-27 22:55:20 +08:00
Cameron Norman
ad5ad3d1ad Fix bug for systemd being installed but not PID 1 2014-06-20 11:08:35 +08:00
ridiculousfish
3bc2dda00d Merge branch 'death_of_fishd'
Incorporates more removal and cleanup of fishd remnants.
2014-06-18 11:19:28 -07:00
ridiculousfish
ee8e9c0291 Remove env_universal.h and env_universal.cpp from project 2014-06-18 10:14:35 -07:00
David Adam
f4bc1ef4a2 docs: clarify fish_greeting function and variable in FAQ
Tidy fish_greeting section in main documentation.

Closes #1506.
2014-06-18 17:29:59 +08:00
ridiculousfish
3513ce3ac0 Universal variable callbacks should only be announced for changed
values, not every value. Also support erase notifications.
2014-06-16 12:27:28 -07:00
ridiculousfish
6277a2e4a4 Migrate global functions out of env_universal. Have env operate directly
on an env_universal_t.
2014-06-15 17:30:50 -07:00
ridiculousfish
84faa60c4e Fix Linux build of env_universal_common 2014-06-13 15:35:37 -07:00
ridiculousfish
735195e8ea Teach env_universal_remove to directly report whether the variable was
successfully removed.
2014-06-13 15:15:11 -07:00
Konrad Borowski
0f15ab8d05 Allow fast failure on Travis. 2014-06-11 20:44:41 +02:00