Cumulatively 10% of user time, give or take.
These are mainly pointless multibyte to wide string conversions.
The hit to source code readibility is minimal.
As the specification says we should. GLib does this as well.
It is still possible to achieve an empty set by using ":",
which are two non-absolute paths that should be ignored.
GLib doesn't implement this. Thus, we're now better than GLib.
I was hoping that a superoptimiser would help me find a miraculous
branchless equation to cover it, but in the end the branching
doesn't hurt at all in our case.
It's more readable than `(((char >> 2) - 0x38) & 0x60) ^ char`
or `(char ^ 0x40) & (((char >> 1) ^ 0x20) | 0x5f)`.
Copying snippets from the README was uncomfortable and laborious,
and wasted a lot of space in the document, especially after
the recent additions.
Closes#3
SIGTSTP is sent to the entire foreground process group,
so do the some with our SIGCONT.
Debian's default sh (dash) doesn't replace itself with
the command, even if it's the last one in the -c option.
Of course, we do not need to use /bin/sh for the helpers
at all, though it doesn't cost us much. We could also
issue an explicit `exec`.
zsh's antisocial behaviour was fairly promptly fixed (thanks to
Stephane Chazelas and his patience).
zle-line-init and zle-line-reset seem to be user-defined widgets
and the order inverted. Put zle-line-init before reset-prompt
because some people do weird things in there.
There's a slight issue with the inverted cell representing
the cursor standing out a bit too much amongst the rest of
the characters.
The resulting experience is a lot more consistent, though.
Since I'm already dealing with the fish shell.
All of our supported shells seem to handle cursor position
in Unicode (wide character) codepoints.
It was easiest and most straight-forward to pass the data
through yet-unused program arguments.
The cursor position is marked by a Unicode glyph equivalent
to ACS_DIAMOND, although ncurses doesn't get a chance
to make any ACS translation.
That is, if it's missing from our history.
This makes for a more consistent experience when traversing
the filesystem. Arguably, it's only good for when 'h' is
bound to the 'parent' action.
Also make sure that the offset and cursor are reset when
the path is changed.
Just whether it's safe for it to keep an anchor on the current item.
I've left in the safety check for an empty entries array,
for the theoretical case of an empty or entirely filtered-out root
directory. It will likely crash in that case, anyway,
the cursor may be either -1 or 0.
Usually, when the pager or the editor fail and return a non-zero
exit status, they display a message on the standard error output.
We might also try to redirect this output to show_mesage() but
it might not fit as a whole, so, given the relative rareness
of this situation, this slight inconsistency shouldn't be much
of an issue.
It'd also be possible to redirect the output to run_pager() but
in doing so, we might make the problem recursive.