Commit Graph

348 Commits

Author SHA1 Message Date
ridiculousfish
767742c7e7 Rework how the mode is reported in fish_vi_mode
Add a new function fish_mode_prompt which (if it is defined) has its output
prepended to the left prompt. Rather than replacing the prompt wholesale, make
fish_vi_mode enable this function by setting a variable __fish_vi_mode. This
enables vi mode to interoperate nicely with custom prompts. Users who want
to change how the mode is reported can either redefine this function or
erase it entirely. Fixes #1988.
2015-06-14 11:36:11 -07:00
Michael Steed
cb984cf761 Add 'bigword' vi key bindings
- Add four new functions: forward-bigword, backward-bigword,
  kill-bigword, backward-kill-bigword
- Add new enum move_word_style_whitespace and related state machine
  method
- Change vi key bindings to operate on bigwords: B, gE, W, E, dW, diW,
  daW, dE, dB, dgE, cW, ciW, caW, cE, cB, cgE, yW, yiW, yaW, yE, yB,
  ygE
2015-06-04 12:09:02 -07:00
ridiculousfish
905d8b2aa5 Don't stop history search on repaint
Fixes #2044
2015-05-02 18:42:38 -07:00
ridiculousfish
3ca518255e Treat comments ending in backslashes as not continuing onto the next line
Fixes #1255
2015-05-02 18:22:20 -07:00
ridiculousfish
c59119e0b7 Correct a reference to the wrong issue. 613, not 163! 2015-05-02 17:54:32 -07:00
ridiculousfish
0748a4d8b6 Use a more appropriate type for the reader_test function 2015-05-02 17:49:38 -07:00
ridiculousfish
c3ef23b10f Support for a "pending item" in history.
Before running a command, we add the command to history, so
that if the command causes us to exit it's still captured in
history. But that command should not be considered part of
history when expanding the history within the command itself.
For example, `echo $history[1]` should be the previously
run command, not `echo $history[1]` itself.

Fixes #2028
2015-04-20 02:04:17 -07:00
ridiculousfish
7aac3db55c Make "readahead" text insertion clear the pager
Without this change, pasting text with the pager contents
visible would not clear the pager.

Fixes #1974
2015-03-23 12:09:16 -07:00
ridiculousfish
0ecf294d34 Use natural (digit-sequence-aware) sorting for wildcard expansion
Fixes #1993
2015-03-23 11:13:26 -07:00
Martin Hamrle
94e9d6a5ef Add paging into navigating pager 2015-03-20 14:41:38 +08:00
David Adam
bff68f3bfc reader.cpp: during forced exit, send SIGHUP to foreground processes only
Closes #1771.
2015-03-12 14:11:06 +08:00
David Adam
981a71555f reader.cpp: don't set title in dumb terminals
Closes #1907.
2015-02-02 15:41:29 +08:00
Ben Hamilton
b31305b9bd Unexport CMD_DURATION
Valid uses of this environment variable don't really include passing
it to subsequent child processes.

I confirmed the fix with:

  function fish_prompt
      echo "cmd duration [$CMD_DURATION] "
  end

  cmd duration [0] sleep 2
  cmd duration [2002]
2015-01-16 11:57:26 -08:00
David Adam
9b43e6fa8b use configure to define NOMACROS
(added in 9ec808a4c)
2014-12-21 23:38:02 +08:00
David Adam
a8059c5962 Solaris build fixes: pick the right curses more of the time 2014-12-21 23:37:23 +08:00
ridiculousfish
701a37fd00 Fix to avoid shortening the command line on tab completions.
This prevents cases like `cd /usr/e` from tab-completing to
`cd /usr/` (which is the shared prefix of the tab completions).

Things are still sort of confusing with fuzzy matching, e.g.
with files like this:

    foo1bar
    foo2bar

Then ba<tab> will replace the token with foo. That's surprising,
but not new to this fix.

Fixes #1727
2014-11-06 10:13:33 -08:00
ridiculousfish
fa588db148 Fix to swallow BOMs in sourced files
Fixes #1518
2014-11-01 16:25:28 -07:00
ridiculousfish
7ac593273e Remove a bunch of dead code identified by cppcheck 2014-10-31 01:15:50 -07:00
Jan-Thorsten Peter
646d9ab431 Added fish_preexec and fish_postexec events
Fixes #1549.
2014-10-01 15:09:35 -07:00
Kevin Ballard
35595dbffd Make escape() return a wcstring
This avoids the potential for leaking the resulting string.
2014-09-25 18:20:03 -07:00
Kevin Ballard
b480c8ce79 Allow U+F8FF to be typed
U+F8FF is the last character in the private use area, but it's also the
codepoint used for the Apple symbol (), which is typeable on US
keyboards in OS X, and so should actually work.
2014-09-21 21:03:44 -07:00
ridiculousfish
7229d7a326 Make redirections and pipes expand abbreviations too 2014-09-19 14:05:33 -07:00
ridiculousfish
1a7b33e8fb Expand abbreviations on semicolon per #731 2014-09-19 13:59:53 -07:00
Kevin Ballard
4b7dc525b8 Fix the fix for commandline -i in binds 2014-09-03 23:05:48 -07:00
Joseph Tannhuber
4acea72700 New -n option for read builtin
Usage: read -n nchars
Reads maximum of nchars characters. If nchars <= 0, there's no limit.
2014-09-03 22:48:37 -07:00
Kevin Ballard
24ac7d2698 Fix commandline behavior in bind functions
When a key is bound to a fish function, if that function invokes
`commandline`, it gets a stale copy of the commandline. This is because
any keys passed to `self-insert` (the default) don't actually get added
to the commandline until a special character is processed, such as the
R_NULL that gets returned after running a binding for a fish command.

To fix this, don't allow fish commands to be run for bindings if we're
processing more than one key. When a key wants to invoke a fish command,
instead we push the invocation sequence back onto the input, followed by
an R_NULL, and return. This causes the input loop to break out and
update the commandline. When it starts up again, it will re-process the
keys and invoke the fish command.

This is primarily an issue with pasting text that includes bound keys in
it. Typed text is slow enough that fish will update the commandline
between each character.

---

I don't know of any way to write a test for this, but the issue can be
reproduced as follows:

    > bind _ 'commandline -i _'

This binds _ to a command that inserts _. Typing the following works:

    > echo wat_is_it

But if you copy that line and paste it instead of typing it, the end
result looks like

    > _echo wat_isit

With this fix in place, the pasted output correctly matches the typed
output.
2014-08-29 12:29:48 -07:00
ridiculousfish
6ce74febc7 Accepting an autosuggestion should clear the pager 2014-08-11 10:17:41 -07:00
Gio d'Amelio
bcda3f1baa Set $CMD_DURATION to milliseconds. Fixes #1585 2014-08-04 13:36:39 +08:00
ridiculousfish
b97a94ccc8 Clean up reader_write_title to work with wcstring 2014-08-02 21:01:40 -07:00
jianjun
87abcecca6 add command line string as $argv[1] for fish_title 2014-08-02 12:57:38 -07:00
ridiculousfish
2bb08a4ca0 Make abbreviations work correctly with type-ahead
Fixes #1434
2014-07-25 12:23:42 -07:00
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
891f55b2b3 Fix for crash in kill-whole-line
Fixes #1548
2014-07-13 14:06:35 -07:00
ridiculousfish
0d3169ef70 Run restyle.sh to enforce style rules. 2014-03-31 10:01:39 -07:00
ridiculousfish
28fd1a4c5d Merge branch 'master' of github.com:fish-shell/fish-shell 2014-03-30 21:58:32 -07:00
ridiculousfish
bd895aa76c Changes to bind_mode implementation based on code review and merge
errors
2014-03-30 16:58:46 -07:00
ridiculousfish
d4fafeb6d6 Merge branch 'master' into 1218_rebase
Conflicts:
	builtin.cpp
	builtin_commandline.cpp
	highlight.cpp
	input.cpp
	input.h
	reader.cpp
	screen.cpp
	screen.h
2014-03-29 14:19:45 -07:00
ridiculousfish
aa1b065dd1 Allow appending path hints to history items after they have been added,
allowing us to avoid the delay before items appear in history. Should
fix #984
2014-03-28 23:22:03 -07:00
ridiculousfish
31bf50b2d4 Equip syntax highlighting with a variant that does no disk I/O. Invoke
it after expanding an abbreviation, so that the expanded abbreviation
appears with (some) syntax highlighting.
2014-03-26 18:49:09 -07:00
ridiculousfish
2c19ca0dbf Fix for issue where pager contents may stay around if you executed a
command with pager contents visible
2014-03-20 21:32:02 -07:00
ridiculousfish
73c2846d64 Remove support for input IO_BUFFERs, which were only used by fish_pager 2014-03-15 19:49:55 -07:00
ridiculousfish
2442ae60db Remove old fish_pager source and implementation 2014-03-15 14:00:18 -07:00
ridiculousfish
6c096191ba Remove support for invoking old pager 2014-03-15 13:46:15 -07:00
ridiculousfish
be33d3f2a4 Revert "Merge pull request #1317 from pullreq/cpp"
This reverts commit 74135c0600, reversing
changes made to 6d749789ce.

See discussion in #1317
2014-02-28 02:16:48 -08:00
Geoff Nixon
18dd6f58e3 Fixes .c -> .cpp in comments. For doxygen. 2014-02-27 06:23:40 -08:00
ridiculousfish
8eaabacf44 Allow double-tapping tab to fully disclose pager, per #291 2014-02-20 13:30:26 -08:00
ridiculousfish
2253c57628 Remove the reader_selected_completion_changed callback. Fix a hang when
the pager gets empty, as reported in 291
2014-02-16 19:59:00 -08:00
ridiculousfish
afd6ca314c Make COMPLETE_AND_SEARCH always show the search field. Also end paging upon
modifying the command line contents.
2014-01-28 07:30:05 -08:00
ridiculousfish
441522f97b Make return not execute the selected completion in the pager, instead
just accept it
2014-01-27 22:01:38 -08:00
ridiculousfish
369229ea71 Make escape clear the current completion 2014-01-27 02:28:19 -08:00