Commit graph

6260 commits

Author SHA1 Message Date
Aaron Gyes
96ebfaaf87 Use 'grealpath' if installed for realpath fallback (#3374)
* Use 'grealpath' if installed for realpath fallback

See discussion in #3370

* fish_realpath: filter out dangerous options

Per feedback do not use aliases to declare wrapped functions.
2016-09-18 02:08:19 -07:00
Aaron Gyes
30b71fbb78 $(v)echo foo -> $v echo foo for verbosity modifier
Not sure why I crammed $(v) up like that with the parens. This is
a little sed job after regretting the Makefile seeming harder to read.
Certainly better.

We want clang or gcc picked for both C++/C

Few final cleanups - time to feed it to Travis.
2016-09-17 16:29:43 -07:00
Clément Martinez
fc3cd77c2f Add pygmentize completions 2016-09-16 19:23:22 +02:00
Clément Martinez
22c20f36cb Add ranger completions 2016-09-16 19:23:22 +02:00
Clément Martinez
46ab1a155c Add mdbook completions 2016-09-16 19:23:22 +02:00
Clément Martinez
29b9e6705a Add figlet completions 2016-09-16 19:23:13 +02:00
Clément Martinez
ed7bf83b56 Fix xz file completion
The previous completion gave every files.
Here, we only show files with the .xz, .txz, .lzma or .tlz extension.
2016-09-16 19:22:59 +02:00
Andrew Schulman
0a6dc2addb use PATH to find getent in __fish_complete_groups (#3383) 2016-09-16 18:26:27 +02:00
Andrew Schulman
05b52eaa0b use __fish_complete_groups to complete group names for chown (#3380)
chown completion chown currently uses cat /etc/group to fetch the list of group names. In Cygwin there's no /etc/group file any more (user and group names are fetched directly from the OS), so when a user tries to tab-complete the group name they get an error message:

ASchulma@LZ77E1AASCHULMA ~/d/fish> chown ASchulma🐱 /etc/group: No such file or directory

This change fixes that by using getent group (via __fish_complete_groups) by preference to get the group names, and falling back to /etc/group. This is more portable.
2016-09-16 16:35:55 +02:00
Aaron Gyes
e14ae90cc8 mass-rename T_BLAH to cause less visual raucus
"em" is italics
"bo" is bold
sgr0 is sgr0
red  is red

.. and so on in an arbitrary manner.
2016-09-16 00:14:50 -07:00
Aaron Gyes
06c658dd5e Autotools build: teach it clang, utility macros
Teach autotools about clang++.
 - Use AC macros for these utilities in Makefile:
    LN_S, MKDIR_P, AWK, GREP, FGREP.
   This has the effect on OS X with prefixed coreutils installed
   from macports: > make show-LN_S show-MKDIR_P show-AWK show-GREP
    LN_S = 'ln -s'
    MKDIR_P = '/opt/local/bin/gmkdir -p'
    AWK = 'awk'
    GREP = '/opt/local/bin/grep'
    FGREP = '/opt/local/bin/grep -F'
 - Use GNU Make findstrings, wildcard,notdir,
 - SHELL = @SHELL@ per reccomended practice and in line with
    actual behavior.
 - Add output for string wrangling steps
2016-09-15 23:24:41 -07:00
EMayej Bee
85cd372a4e Fix index out of bounds
When current dir is the first one in history. There is no previous dirs.
2016-09-13 20:59:18 -07:00
Kurtis Rader
f9115b5ef1 fix use of subcommand in __fish_config_interactive.fish 2016-09-12 18:47:59 -07:00
Fabian Homborg
9d69f44550 Add completions for cd -
Fixes #3353.
2016-09-12 23:13:32 +02:00
Fabian Homborg
c57b30cba1 Check /etc/os-release for Suse's CNF-handler
This has the same name and path as ubuntu's, but takes less arguments.

So we need to actually find if the distro thinks it is suse, and then
use it.

Fixes #3366.
2016-09-12 22:59:35 +02:00
Fabian Homborg
bb754c2085 ls.fish: Replace eval with string 2016-09-12 20:20:40 +02:00
Aaron Gyes
f7c6426b21 Merge floam/colorfix #3260 2016-09-11 03:14:08 -07:00
Aaron Gyes
90e535f66f Update pager colors, tweak pager.cpp
Adds a color reset thing, to ensure fish tries to use hard colors during
testing.

Also, work on a discrepancy (not introduced by my changes, afaik) when
with some combinations of color settings, and usage of --bold, caused super
flakey color paninting in the pager. Downwards movements that trigger
scrolling vs. upwards movement in the pager would only apply bold to
selections when moving upwards. The bold state of the command completions in
the pager was flipping flops on and off, depending on if there is a description
on the preceding line.

Implement a lame fix by reseting the color to normal and applying a
different style on the rightmost ')' which seems to be what was influencing it.

Makes fish use terminfo for coloring the newline glich char.
2016-09-11 03:04:53 -07:00
Aaron Gyes
af95813514 Merge branch 'master' of https://github.com/fish-shell/fish-shell into colorfix 2016-09-10 15:09:12 -07:00
Aaron Gyes
82b298dcc5 __fish_config_interactive: remove Linux exception
And update colors.
2016-09-10 15:07:58 -07:00
Aaron Gyes
ae32d0288b Remove fish_wcstoi decl - fix style 2016-09-10 14:56:43 -07:00
Aaron Gyes
b17ebb4551 Merge branch 'master' of https://github.com/fish-shell/fish-shell 2016-09-10 14:52:15 -07:00
Aaron Gyes
6faa2f9866 Tighten up empty string checks.
Fixes various spots throughout fish where broken strtoi checks
were converting empty strings to zero. Zero is not a valid pid and
this was causing breakage as well when input.

Nix fish_wcstoi - wcstoimax does the same thing.
Improve comments and some general cleanup.
2016-09-10 14:46:06 -07:00
David Adam
0335921c3c Revert "Sync up autoconf with rest of project"
This reverts commit 2822dfc92d.

The commit broke the build on Ubuntu Precise:
 https://launchpad.net/~fish-shell/+archive/ubuntu/nightly-master/+build/10731279/+files/buildlog_ubuntu-precise-amd64.fish_2.3.1-523-g87a532f-1~precise_BUILDING.txt.gz
and increased the configure time by about 80%. None of the new symbols
are used yet.

Discussed with @floam (original committer) on Gitter.
2016-09-10 13:09:47 +08:00
Kurtis Rader
af0a2add10 fix check for unsupported op on BSD
Fixes #3362
2016-09-09 19:36:26 -07:00
Kurtis Rader
87a532f533 make it hard to use history command incorrectly
Fixes #3307
2016-09-09 19:23:06 -07:00
ridiculousfish
fa837a2e4a Prevent crash when reaping jobs in exit handlers
If an interactive job is started, and it is reaped within fish's
exit handler, we may attempt to print its status message after
cur_term has been set to NULL. This results in a crash.

This change makes fish only print the status message if cur_term is
not NULL.

Fixes #3222
2016-09-09 13:13:45 -07:00
Aaron Gyes
f0125734d0 Improve make install and make uninstall experience
Show the gist of what is going on during uninstall.

I had overlooked the uninstall target, with it mislabled as having
to do translations. Give make uninstall the full treatment here.

In addition to showing what is going on, give the user a 5^H7 second
warning before we blast away /usr/local/share/fish/ - it's not
unthinkable they might have a script or two in there.
2016-09-09 01:24:24 -07:00
Aaron Gyes
c0c8fffd50 Update install-sh
Copied in manually - this won't be done automatically by autotools.
(we only use autoconf)

From automake NEWS:

New in 1.15:

* Improvements and refactorings in the install-sh script:

  - It has been modernized, and now makes the following assumptions
    *unconditionally*:
    (1) a working 'dirname' program is available;
    (2) the ${var:-value} shell parameters substitution works;
    (3) the "set -f" and "set +f" shell commands work, and, respectively,
        disable and enable shell globbing.

  - The script implements stricter error checking, and now it complains
    and bails out if any of the following expectations is not met:
    (1) the options -d and -t are never used together;
    (2) the argument passed to option -t is a directory;
    (3) if there are two or more SOURCEFILE arguments, the
        DESTINATION argument must be a directory.
2016-09-09 01:24:24 -07:00
Aaron Gyes
2822dfc92d Sync up autoconf with rest of project
This has gotten very out of sync with the project - autoupdate it and
integrate what autoscan found.

I checked with @zanchey - it looks like even our oldest RHEL 5 machines
have a new enough M4 to be able to handle what will be produced by
autoconf 2.68; also use a closer-to-modern version of that (2.69 was
released 2012!)

Neither m4 nor autoconf are required to build a fish release.
2016-09-09 01:24:24 -07:00
Aaron Gyes
87fd9bca02 Group history items together with timestamps on separate line (#3333 from floam/historyout) 2016-09-07 07:57:06 -07:00
Aaron Gyes
3d6cb59b31 Use %Y-%m-%d %H:%M:%S format, update tests
Update history docs.

Note - the omission of a mention of timezone was intentional. These were recorded as naive timestamps lacking timezone information in the first place.
2016-09-07 07:52:45 -07:00
Aaron Gyes
6936e64b34 Show history timestamps on seperate lines #-prefixed.
Improves the grouping of multiline history entries
by sepearating the timestamps and history entires onto seperate lines.

Use wcsftime() Saves us a conversion, might as well.
2016-09-07 07:51:32 -07:00
Fabian Homborg
f78f51e2a7 dirh: Don't rely on negative increments in seq
Not available in BSD seq.

Fixes #3354.
2016-09-06 18:15:00 +02:00
Aaron Gyes
578e4e8207 Don't use colors over 8 during builds
T_DIM to only highlight the "important" CXX lines seems distracting.
Use it only for the pages of output from re-running configure
2016-09-06 04:59:37 -07:00
Aaron Gyes
f7daa5884a Update issue template
- Comment out asciinema - people too often leave a link there.
- "Launch fish" is probably a stupid thing to have a first step. 
- Combine the expected/actual result sections, maybe that was too tedious.
2016-09-06 03:58:06 -07:00
George Christou
f0e884075c Mute output from command -v tput (#3355)
The previous change here caused an obviously unwanted path to the `tput` command to be left on the prompt after ^C.
2016-09-06 02:37:52 -07:00
Kurtis Rader
363fa0a598 make printf test resilient to missing locale
Another dev noticed that tests/printf.in was failing because they didn't have
the fr_FR.UTF-8 locale installed. Make that test more resilient by trying
other locales and if no suitable locale is found skipping the test.
2016-09-05 20:59:09 -07:00
Fabian Homborg
9f6ba5db7a Disable fish_vi_cursor in unsupported TERMs 2016-09-05 14:44:03 +02:00
Fabian Homborg
cac3b239e3 Use fish_vi_cursor by default
Fixes #3215.
2016-09-05 01:28:21 +02:00
Fabian Homborg
b0716885bc Set cursorshape on preexec, reset on post
Fixes #3217.
2016-09-05 01:20:12 +02:00
Fabian Homborg
a0623e870b Only set bind mode if it changed
This is potentially costly (as functions listening for the variable will
be executed).

Fixes #3216.
2016-09-05 00:58:52 +02:00
Fabian Homborg
7ce042ccff Really allow for hybrid bindings
The previous solution would not erase the previous bindings if
fish_vi_key_bindings was called with a mode argument. So if the user
switched to vi with a different initial mode, they'd keep their previous
bindings also.

Supersedes e89057b.
2016-09-05 00:47:37 +02:00
Fabian Homborg
30f26b62e6 Remove duplicate bindings
Some of these were defined in the shared bindings, some (like \cy yank)
were just literally duplicate in the same files.

This should _not_ change anything. In particular this does not remove
hardcoding of sequences (because terminfo might be wrong or the term
might need smkx).

Found with

```
function bind
	set -l binds (builtin bind)
    builtin bind $argv
    set -l newbinds (builtin bind)
    if set -q argv[1]; and not test "$argv[1]" = "--erase"
        if test "$binds" = "$newbinds"
            echo "Duplicate: " (string escape -- $argv)
        end
    end
end
```
2016-09-04 22:48:40 +02:00
Fabian Homborg
e89057b70c Make hybrid bindings easier to achieve
The vi-bindings function would unconditionally erase all bindings,
making it impossible to call it last. This would disable the
mode-indicator (and in future also the cursor).

Make it so any argument to fish_vi_key_bindings stops it from erasing
bindings.

It would also be possible to demand an argument to erase (or to erase as
a separate step). but the usual case seems to be _switching_ to a set of bindings.
2016-09-03 23:11:36 +02:00
Fabian Homborg
1bc887cd9f Vi-mode: Also share end/home bindings
Fixes #3298.
2016-09-03 23:11:36 +02:00
Kurtis Rader
6b1801063b fix raw_string_to_scalar_type locale handling
Fixes #3334
2016-09-02 18:48:16 -07:00
Aaron
b895a50bb2 Sorry. This fixes the not-quoted variables. 2016-09-01 10:35:45 -07:00
Aaron Gyes
4b740d1fb6 Fix make install 2016-09-01 10:09:29 -07:00
Aaron Gyes
e54b30d138 Fix the Travis build. 2> /dev/null omission.
The last few commits broke Travis. `tput`'s errors weren't
being tossed out, and T_WHITE was left there.
2016-09-01 09:46:02 -07:00