Commit Graph

5180 Commits

Author SHA1 Message Date
ridiculousfish
594b460ba2 Allow and/or statements to attach to the if/while header
For example:

  if false; or true; echo hello; end

will output 'hello' now.

Fixes #1428
2015-12-19 14:49:07 -08:00
ridiculousfish
0a6f62358b Write tests for new if/and/or behavior (#1428)
They fail for now.
2015-12-19 11:32:57 -08:00
ridiculousfish
8c707a4e2f Simplify parser implementation
Rather than returning a list of productions and an index,
return the relevant production directly from the rule function.

Also introduce a tag value (replacing production_idx) which tracks
information like command decorations, etc. with more clarity.
2015-12-19 11:17:13 -08:00
ridiculousfish
7188d94c1b Update osx/config.h for new ifdefs 2015-12-18 21:29:49 -08:00
Fabian Homborg
836b6bea73 git completions: Add commit hashes for show
That's probably the part where commit hashes are most used, we can add
the other subcommands later.

This generates a _lot_ of options, so hooking it up everywhere would be
unwise, though our pager helps quite nicely with filtering - typing
"Branch" will filter out the commits, and typing other things will
filter the subjects, which is quite cool.
2015-12-18 17:07:43 +01:00
Fabian Homborg
8a6f26ff9b Document prompt_pwd
Fixes #253
2015-12-17 15:25:13 +01:00
David Adam
7143512198 detect and provide fallback for backtrace_symbols_fd
Closes #2615 to fix includes on FreeBSD and provide fallback on Cygwin.
2015-12-17 20:36:33 +08:00
Fabian Homborg
5306fce16e mount completions: Support spaces in mountpoints
This turns '\040' into a space. /etc/mtab also supports other
escapes ("\\" for backslash, "\011" for tab), but I can't find
documentation for those in fstab.
2015-12-17 12:35:16 +01:00
Fabian Homborg
fb1a7d9d73 Port linux __fish_print_mounted to string
This adds a few escape sequences, but two out of the three are
theoretical and will fail a bit later.
2015-12-17 12:14:03 +01:00
Fabian Homborg
482cfca84f Make informative_git prompt use vcs_prompt -> Rename it to "Informative Vcs" 2015-12-16 19:05:28 +01:00
Fabian Homborg
e29d200ba5 Switch classic + git prompt to all vcsen -> Rename it to Classic + Vcs
Keep the variable names for now.
2015-12-16 19:05:28 +01:00
Fabian Homborg
43c7ababf9 Make lonetwin prompt use __fish_vcs_prompt 2015-12-16 19:05:28 +01:00
Fabian Homborg
baa6971a46 Add __fish_vcs_prompt helper function
This is supposed to be used by prompts so they'll get all known vcsen
integrated.

For now, there's no distinction between the different vcsen.
2015-12-16 19:05:28 +01:00
Fabian Homborg
aefe084124 Merge pull request #2607 from jakwings/doc
Improve documentations (see #354)
2015-12-16 16:35:17 +01:00
Kurtis Rader
c68f8f3418 restore the terminal modes before an "exec"
When replacing the existing fish process with a new process it is
important to restore the temrinal modes to what they were when fish
started running. We don't want any tweaks done for the benefit of fish
(e.g., disabling ICRNL mode) to bleed thru to an "exec"ed command.

Resolves #2609
2015-12-15 23:40:53 -08:00
David Adam
aa5291c6bd configure/docs: update sf.net to sourceforge.net
Closes fish-shell/fish-site#29

[ci skip]
2015-12-15 21:49:40 +08:00
Fabian Homborg
f045d9b143 Improve mount completion (now with blockdevices!)
This adds blockdevices (and directories) and fixes the regexes to no
longer include comments but include UUID= and LABEL=, which at least
util-linux mount understands.

It also shouldn't fail on systems without fstab any longer (like default OSX).

Fixes #2606.
2015-12-13 20:38:38 +01:00
Jak Wings
666dcd78ba Doc: Link Cartesian Product in tutorial to main documentaion. 2015-12-14 02:36:00 +08:00
Jak Wings
70ee7650f3 Doc: Introduce Cartesian Products on the main documentaion page. 2015-12-14 02:36:00 +08:00
Jak Wings
aa974b58bc Doc: Introduce another simple way to separate variable names from text.
This can avoid the confusion between brace expansion and the cartesian
product behavior of arrays, even if braces can help to do some hacks.
2015-12-14 02:36:00 +08:00
Fabian Homborg
6c8518dd10 Update vte cwd on launch
Fixes #2418
2015-12-12 12:22:08 +01:00
Fabian Homborg
346d918555 Delete upstreamed docker completions
A better version of these has been in an upstream release, so there's no
need to keep this around.
2015-12-12 12:13:05 +01:00
Fabian Homborg
8104854d5d Update makepkg completion
A few options were missing and --asroot has been removed
2015-12-11 12:19:30 +01:00
Tanner Bruce
b4b5c2188f Check that $XDG_RUNTIME_DIR is valid and accessible
Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au>
2015-12-11 15:02:36 +08:00
David Adam
a0eef2663a git completions: add missing description flags
Fixes syntax error introduced in 4280df3aa2.
2015-12-11 10:42:19 +08:00
Samantha Marshall
f5dfebb6a3 Add __fish_svn_prompt function
This refactors __fish_print_svn_rev to not depend on english locale
2015-12-10 18:17:40 +01:00
Fabian Homborg
2b7ffca414 Merge pull request #2595 from lordlycastle/master
Added OS X completions for open, and seq.
2015-12-10 15:32:18 +01:00
lordlycastle
96b3e1ce1b Added OS X completions for open, and seq. Added missing stdout redirection to /dev/null when checking command's version. 2015-12-10 14:20:46 +00:00
Fabian Homborg
ce719a700c Mention /etc/shells in README.md 2015-12-10 13:10:20 +01:00
mr.Shu
4280df3aa2 git: Add missing options to git clone
* Add missing options to `git clone` in order to make the suggestions as
  similar to the manual (https://git-scm.com/docs/git-clone) as
  possible.

Signed-off-by: mr.Shu <mr@shu.io>
2015-12-10 12:54:45 +01:00
Fabian Homborg
b73bf53bd3 Enable 24-bit mode for selected terminals
Unfortunately, there's no standard way to detect support (importantly,
terminfo doesn't encode it), but there's a variety of terminals that
support it that we can detect.

It's better than letting this functionality go to waste.

Check KONSOLE_PROFILE_NAME instead of DBUS_SESSION because Konsole can be compiled without dbus support.

Check ITERM_SESSION_ID's format for 24bit support

This has changed since the last release, just like 24bit support. So if
we check one, we get the other.
2015-12-10 12:47:45 +01:00
ridiculousfish
d90169e79b Remove a stale comment regarding fishd 2015-12-10 01:02:57 -08:00
Andy Lutomirski
fea798011b Switch show_stackframe to backtrace_symbols_fd
It's simpler and avoids calling into fprintf in contexts in which
it might crash or deadlock.
2015-12-10 01:02:57 -08:00
Andy Lutomirski
f17a71de74 Don't complain if do_builtin_io fails due to EPIPE
If stdio is dead due to EPIPE, there's no great reason to spew a stack dump.

This will still write an error to stderr if stdout dies.  This might be
undesirable, but changing that should be considered separately.
2015-12-10 01:02:57 -08:00
Fabian Homborg
0212314479 Merge pull request #2586 from mrshu/mrshu/add-git-cherry-pick-options
git: Add more options to `git cherry-pick`
2015-12-09 16:41:34 +01:00
Kurtis Rader
16c34b387f Ensure interactive tty modes are set ASAP
It is critical that we ensure our interactive tty modes are in effect at
the earliest possible moment. This achieves that goal and is harmless if
stdin is not tied to a tty. The reason for doing this is to ensure that
\r characters are not converted to \n if we're running on the slave side
of a pty controlled by a program like tmux that is stuffing keystrokes
into the pty before we issue our first prompt.
2015-12-08 21:01:31 -08:00
Kurtis Rader
d65c63322e allow \cJ (\n) to be bound separate from \cM (\r)
This makes it possible (on UNIX systems, don't know about MS Windows)
to bind \cJ (\n) independently of \cM (\r, aka [enter]).

Resolves #217
2015-12-08 21:01:31 -08:00
ridiculousfish
6943536ef3 named_color_names to reserve the right amount 2015-12-08 20:32:59 -08:00
Kurtis Rader
7322c9c591 "normal" should appear in set_color --print-colors 2015-12-08 20:08:08 -08:00
Kurtis Rader
dfaefb97ff remove "normal" from the basic color name table
The special token "normal" should not be in the basic sixteen color table
because a) it is not a color, and b) it is special cased with the result of
resetting the terminal colors (usually via a ANSI X3.64 CSI [0m sequence).
2015-12-08 20:08:08 -08:00
Kurtis Rader
0a0acc8a2e add support for ANSI "bright" colors
This adds support for the ANSI x3.64 "bright" colors in the basic sixteen
color palette. This is especially useful when trying to use the base colors
as a background color. The "bright" variants tend to be more useful as
background colors compared to the non-bright variants.

This also fixes a bug in so far as palette number 7 is actually grey and
not white whereas palette number 15 is white. At least on the terminal
emulators on which I've tested this change (Ubuntu xterm & uxterm, Mac
OS X Terminal & iTerm2).

Resolves issue #1464.
2015-12-08 20:08:08 -08:00
mr.Shu
a8837f537f git: Add more options to git cherry-pick
* Add more options to `git cherry-pick` so that the suggested options
  mimic the man page (https://www.git-scm.com/docs/git-cherry-pick/).

Signed-off-by: mr.Shu <mr@shu.io>
2015-12-08 23:51:29 +01:00
David Adam
ef67fc7ba0 __fish_complete_man: rework AWK script
Adds support for the man-db alias format used in CentOS/RHEL 5
Adds basic support for the output of apropos on Solaris

Work on #2087.
2015-12-04 16:23:57 +08:00
David Adam
83c0f43b33 configure.ac: use correct headers for TPARM_SOLARIS_KLUDGE check
Should fix the build at least partly on msys2.
2015-12-04 13:23:10 +08:00
ridiculousfish
17672b08c6 Don't print the jobs header when stdout is redirected 2015-12-03 21:08:48 -08:00
Max Nordlund
dc1f2fbb4c Fix the error message not being outputed 2015-12-03 20:59:13 -08:00
Max Nordlund
2d90859cab Fix wrong exit code for jobs #2505 2015-12-03 20:59:12 -08:00
Fabian Homborg
d325b4bf39 Add completion for pkg-config 2015-12-03 13:11:53 +01:00
Fabian Homborg
1d64c480c4 Add completion for systemd-nspawn 2015-12-03 12:53:10 +01:00
Fabian Homborg
9f7334deef Add completion for systemd-analyze 2015-12-03 12:52:59 +01:00