Up till now setting the `-a` flag of the `prompt_fresh_setup` theme
resulted in duplicate prompts being printed to the terminal. The first,
the interactive prompt with syntax highlighting, and a second after a
call to the `clear` command without syntax highlighting. This patch
replaces the old implementation with one which does not use `clear`.
Instead it queries the terminal for the current cursor position, then
uses this to move to the bottom of the terminal, print a number of new
lines to move the stale command output off screen, and finally move
almost back to the top ready for the invoked command to print it's
output.
Make using the `@vim$TMUX_PANE` window flag much more robust by
unsetting it every time the zsh prompt is drawn and setting it again
using a `FocusGained` `autocmd` in vim. This removes the need for the
hacky check for zsh in the conditional defined in the `in_vim` variable.
Following on from the previous commit, use of `RPS1` results in the
prompt being redrawn when the terminal gets narrower, this makes the
line drawn by `fresh_line_one` scroll off the screen. By removing any
use of `RPS1` this behaviour goes away.
* When a command fails, don't print the error code at the end of the
first line but directly after the git stats.
* Remove `cr` from `prompt_opts` since there is no longer a new line in
`PS1`, combined with above, this result in no new lines being inserted
when the terminal becomes narrower e.g. a horizontal tmux split.
* Remove `fresh_visible_length` function and instead use the length of
string variables e.g. `${#userhost}`.
* Add option parsing to `prompt_fresh_setup` to detect when options are
set during setup.
* Add `-a` option to enable almostontop behaviour, every time a command
is invoked the screen is cleared and the is prompt redrawn before the
command begins using the `preexec` hook. `-a` is disabled by default.
* Add `prompt_fresh_help` function to display a description of available
options using `prompt -h fresh`.
* Canonicalize all utility functions for the fresh prompt theme to
follow the `fresh_<name>` convention.
Fixes#1.