Commit Graph

29 Commits

Author SHA1 Message Date
Michihito Shigemura
c5241360af Fix typo in history 2017-11-06 18:48:16 +01:00
David Adam
472e186c2b Rename FISH_HISTORY to fish_history
Work on #4414.
2017-09-24 14:07:45 +08:00
Kurtis Rader
ee1d310651 Implement history search --reverse (#4375)
* Implement `history search --reverse`

It should be possible to have `history search` output ordered oldest to
newest like nearly every other shell including bash, ksh, zsh, and csh.
We can't make this the default because too many people expect the
current behavior. This simply makes it possible for people to define
their own abbreviations or functions that provide behavior they are
likely used to if they are transitioning to fish from another shell.

This also fixes a bug in the `history` function with respect to how it
handles the `-n` / `--max` flag.

Fixes #4354

* Fix comment for format_history_record()
2017-09-14 15:44:17 -07:00
Kurtis Rader
ec14527545 don't import bash history if not default fish hist
Don't import the bash history if the user has specified that a non-default
fish history file should be used. Also, rename the var that specifies
the fish history session ID from `FISH_HISTFILE` to `FISH_HISTORY`.

Fixes #4172
2017-06-30 20:24:55 -07:00
tomassedovic
aec0973196 Make the history session configurable
Using the FISH_HISTFILE variable will let people customise the session
to use for the history file. The resulting history file is:

    `$XDG_DATA_HOME/fish/name_history`

Where `name` is the name of the session. The default value is `fish`
which results in the current history file.

If it's set to an empty string, the history will not be stored to a
file.

Fixes #102
2017-06-30 17:13:02 -07:00
Rory O’Kane
35e1d1e2d8 Fix deprecated flags in history example in docs
Update the Example section in the documentation for the `history` command so that it uses the subcommands instead of the deprecated long options.
2017-04-05 19:55:58 +02:00
Kurtis Rader
9e922a6e02 make status saner vis-a-vis arg parsing
The `status` command currently silently allows incompatible flags (i.e.,
subcommands). Too, using flags to specify subcommands misleads the user
into thinking they can specify multiple subcommands.

We recently modified the `history` command to deprecate using flags for
subcommands. This change does the same for the `status` command.

Fixes #3509
2016-11-07 12:11:08 -08:00
Kurtis Rader
a26f68d63f handle multiline commands in history search output
Fixes #31
2016-10-16 21:33:12 -07:00
Kurtis Rader
f490b56378 make history searching case insensitive by default
Fixes #3236
2016-10-16 20:18:16 -07:00
Kurtis Rader
e9b5505169 add a flag to limit history search results
This adds a flag to the `history search` command to limit the number of
matching entries to the first "n". The default is unlimited. This is
mostly useful in conjunction with aliases (i.e., functions) that are
intended to report the "n" most recent matching history entries without
piping the result through the user's pager.

Fixes #3244
2016-09-23 19:43:58 -07:00
Kurtis Rader
204e79105a allow customizing history --show-time format
It would make fish more friendly if we allowed the user to specify the
format of the history entry timestamps.

Fixes #3361
2016-09-20 20:14:02 -07:00
Kurtis Rader
76c73aa8ce alter history sub-command handling
This deprecates the use of long options for history sub-commands (e.g.,
`history --delete`) in favor of proper sub-commands (e.g., `history
delete`). It also eliminates the short options for those sub-commands.

Also change option processing to allow options anywhere on the command
line to match how the vast majority of fish builtins handle flags.

Replace --with-time with --show-time.

Fixes #3367
2016-09-18 20:09: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
Kurtis Rader
710addde16 fix history --delete regression
The recent change to reconcile the history builtin command and function
broke an undocumented behavior of `history --delete`. This change
reinstates that behavior. It also adds an explicit `--exact` search mode
for the `--search` and `--delete` subcommands.

Fixes #3270
2016-08-10 21:51:01 -07:00
Kurtis Rader
b53f42970c correct handling of history args
This fixes several problems with how the builtin `history` command handles
arguments. It now complains and refuses to do anything if the user specifies
incompatible actions (e.g., `--search` and `--clear`). It also fixes a
regression introduced by previous changes with regard to invocations that
don't explicitly specify `--search` or a search term.

Enhances the history man page to clarify the behavior of various options.

This change is already far larger than I like so unit tests will be added
in a separate commit.

Fixes #3224.

Note: This fixes only a couple problems with the interactive `history
--delete` command in the `history` function. The main problem will be
dealt with via issue #31.
2016-07-20 21:18:48 -07:00
Kurtis Rader
cbee315b1b fix the history function and man page
The previous commit to add a `--with-timestamp` flag to the `history` command
caused me to notice the history function didn't recognize the new long option.
Neither did it recognize the short options for the builtin command. This
change fixes both of those issues.
2016-06-30 22:01:59 -07:00
Fabian Homborg
ffe5736abb History docs: Move descriptions to the corresponding options
This should clarify `--delete`s behavior without `--prefix` or
`--contains` a bit.

Fixes #3054.
2016-05-28 14:22:16 +02:00
Mark Griffiths
66ccae4bfe Consistency fixes 2014-08-26 19:19:24 +01:00
Mark Griffiths
4651919bd8 Make line length, wrapping and spacing consistent 2014-08-19 13:41:23 +01:00
Mark Griffiths
629a39b45b Tutorial auto colouring, Man page and Make fixes
Completely fixes #1557 and the underlying Doxygen changes that caused
it. Should make fish docs simpler and more robust, more consistent and
generally prettier.

todo:
- trap unmarked text as arguments in context
- test & fix sed portability - see in particular. (so far tested on BSD
(Mac) and GNU sed).
- test Makefile changes
- last round of aesthetic changes and getting that ascii fish in there…
2014-08-08 03:44:37 +01:00
Mark Griffiths
cb5c560688 Simplify styling 2014-08-01 13:25:41 +01:00
Mark Griffiths
8ac0fdfea7 Merge branch 'master' into documentation-update
Conflicts:
	doc_src/history.txt
	doc_src/test.txt
2014-08-01 05:16:02 +01:00
Mark Griffiths
c070a2aa3e Documentation update
Rework for Doxygen >1.8. Moved large parts of the documentation to a
simplified format, making use of Markdown enhancements and fixing bad
long options.
2014-08-01 03:37:32 +01:00
ridiculousfish
e9f870e25a Add support for history --merge to incorporate history changes from
other sessions.

Fixes #825
2014-07-25 10:49:12 -07:00
David Adam (zanchey)
1287b9d823 Help cleanup
Large list of changes, including formatting and typos for most commands.

More substantive changes have been made to alias, bind, block, break,
builtin, case, cd, commandline, count, else, emit, fish_config, funced,
function, functions, history, math, mimedb, nextd, not, popd, prevd,
pushd, pwd, random, read, set, set_color, switch, test, trap, type,
ulimit, umask, and while.
2013-05-13 01:48:20 -07:00
Siteshwar Vashisht
25f9105a97 Made history --help show history man page and history is now saved only once while deleting items 2012-06-12 14:20:07 +05:30
Torsten Grust
aad27a7a68 Fixed closing <pre> tag
- Was an opening tag, should have been a closing tag
- Confused Doxygen 1.8.1.1 on my machine (OS X 10.7), resulting in the fish man pages not being installed at all
2012-06-11 13:46:47 +02:00
Siteshwar Vashisht
ec34f2527a Adding history builtin 2012-06-05 09:54:42 +05:30