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-12 07:56:01 +00:00
|
|
|
\section commandline commandline - set or get the current command line buffer
|
2005-09-20 13:31:55 +00:00
|
|
|
|
|
|
|
\subsection commandline-synopsis Synopsis
|
2014-08-01 12:25:41 +00:00
|
|
|
\fish{synopsis}
|
2014-08-01 02:37:32 +00:00
|
|
|
commandline [OPTIONS] [CMD]
|
|
|
|
\endfish
|
2005-09-20 13:31:55 +00:00
|
|
|
|
|
|
|
\subsection commandline-description Description
|
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
`commandline` can be used to set or get the current contents of the command
|
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-12 07:56:01 +00:00
|
|
|
line buffer.
|
2005-09-20 13:31:55 +00:00
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
With no parameters, `commandline` returns the current value of the command
|
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-12 07:56:01 +00:00
|
|
|
line.
|
2005-09-20 13:31:55 +00:00
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
With `CMD` specified, the command line buffer is erased and replaced with
|
|
|
|
the contents of `CMD`.
|
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-12 07:56:01 +00:00
|
|
|
|
|
|
|
The following options are available:
|
2006-10-04 21:39:48 +00:00
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
- `-C` or `--cursor` set or get the current cursor position, not
|
2006-10-04 21:39:48 +00:00
|
|
|
the contents of the buffer. If no argument is given, the current
|
2010-09-18 02:18:26 +00:00
|
|
|
cursor position is printed, otherwise the argument is interpreted
|
2006-10-04 21:39:48 +00:00
|
|
|
as the new cursor position.
|
2014-08-01 02:37:32 +00:00
|
|
|
- `-f` or `--function` inject readline functions into the
|
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-12 07:56:01 +00:00
|
|
|
reader. This option cannot be combined with any other option. It
|
2006-10-04 21:39:48 +00:00
|
|
|
will cause any additional arguments to be interpreted as readline
|
|
|
|
functions, and these functions will be injected into the reader, so
|
|
|
|
that they will be returned to the reader before any additional
|
2007-01-21 15:01:14 +00:00
|
|
|
actual key presses are read.
|
2006-10-04 21:39:48 +00:00
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
The following options change the way `commandline` updates the
|
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-12 07:56:01 +00:00
|
|
|
command line buffer:
|
2005-09-20 13:31:55 +00:00
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
- `-a` or `--append` do not remove the current commandline, append
|
2005-09-20 13:31:55 +00:00
|
|
|
the specified string at the end of it
|
2014-08-01 02:37:32 +00:00
|
|
|
- `-i` or `--insert` do not remove the current commandline, insert
|
2005-09-20 13:31:55 +00:00
|
|
|
the specified string at the current cursor position
|
2014-08-01 02:37:32 +00:00
|
|
|
- `-r` or `--replace` remove the current commandline and replace it
|
2005-09-20 13:31:55 +00:00
|
|
|
with the specified string (default)
|
|
|
|
|
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-12 07:56:01 +00:00
|
|
|
The following options change what part of the commandline is printed
|
|
|
|
or updated:
|
2005-09-20 13:31:55 +00:00
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
- `-b` or `--current-buffer` select the entire buffer (default)
|
|
|
|
- `-j` or `--current-job` select the current job
|
|
|
|
- `-p` or `--current-process` select the current process
|
|
|
|
- `-t` or `--current-token` select the current token.
|
2005-09-20 13:31:55 +00:00
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
The following options change the way `commandline` prints the current
|
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-12 07:56:01 +00:00
|
|
|
commandline buffer:
|
2005-09-20 13:31:55 +00:00
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
- `-c` or `--cut-at-cursor` only print selection up until the
|
2005-09-20 13:31:55 +00:00
|
|
|
current cursor position
|
2014-08-01 02:37:32 +00:00
|
|
|
- `-o` or `--tokenize` tokenize the selection and print one string-type token per line
|
2005-09-20 13:31:55 +00:00
|
|
|
|
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
If `commandline` is called during a call to complete a given string
|
|
|
|
using `complete -C STRING`, `commandline` will consider the
|
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-12 07:56:01 +00:00
|
|
|
specified string to be the current contents of the command line.
|
2006-01-31 21:46:46 +00:00
|
|
|
|
2014-01-17 20:53:01 +00:00
|
|
|
The following options output metadata about the commandline state:
|
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
- `-L` or `--line` print the line that the cursor is on, with the topmost
|
2014-01-17 20:53:01 +00:00
|
|
|
line starting at 1
|
2014-08-01 02:37:32 +00:00
|
|
|
- `-S` or `--search-mode` evaluates to true if the commandline is performing
|
2014-01-17 20:53:01 +00:00
|
|
|
a history search
|
2014-08-01 02:37:32 +00:00
|
|
|
- `-P` or `--paging-mode` evaluates to true if the commandline is showing
|
2014-01-17 20:53:01 +00:00
|
|
|
pager contents, such as tab completions
|
|
|
|
|
|
|
|
|
2005-09-20 13:31:55 +00:00
|
|
|
\subsection commandline-example Example
|
|
|
|
|
2014-08-01 02:37:32 +00:00
|
|
|
`commandline -j $history[3]` replaces the job under the cursor with the
|
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-12 07:56:01 +00:00
|
|
|
third item from the command line history.
|