Commit Graph

111 Commits

Author SHA1 Message Date
Přemysl Eric Janouch 000315165d
Fix the help in absence of a bindings file 2020-10-08 14:28:49 +02:00
Přemysl Eric Janouch d2e4b91262
Fix showing DEL in the help
And in general fix all CTRL processing to handle the DEL character.
2020-10-08 14:28:24 +02:00
Přemysl Eric Janouch c18630295c
README.adoc: add configuration for elvish
And remove it from the "similar software" section.

Our relationship has progressed.

Other unusual shells I've checked before I gave up:
 - nushell lacks the ability to bind keys to user functions
 - yash can but is otherwise way too basic
2020-10-07 20:57:37 +02:00
Přemysl Eric Janouch b53a3a0981
Revisit zsh integration
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.
2020-10-04 14:27:51 +02:00
Přemysl Eric Janouch cf80a15501
Survive a removed CWD, as well as an empty root
All the omitted error checking sometimes sucks a lot,
and I need to include it later anyway.
2020-10-02 16:35:12 +02:00
Přemysl Eric Janouch 2d6d0582a1
README.adoc: fix zsh integration snippet 2020-10-02 15:36:51 +02:00
Přemysl Eric Janouch 5451eba2a3
Make the outer prompt look more normal
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.
2020-10-01 13:40:52 +02:00
Přemysl Eric Janouch b8c767354e
Show external command line if appropriate
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.
2020-10-01 11:58:32 +02:00
Přemysl Eric Janouch c07f557c16
README.adoc: clarify bash problems
I've also tried tcsh but while it /can/ be used for directory
navigation, it has several issues that are much more serious.
2020-10-01 08:41:58 +02:00
Přemysl Eric Janouch 5fff336e77
README.adoc: fix up hswg compatibility 2020-10-01 04:20:10 +02:00
Přemysl Eric Janouch 6e8d816ada
README.adoc: split into subsections 2020-10-01 04:07:56 +02:00
Přemysl Eric Janouch 063938ff60
README.adoc: add configuration for fish 2020-10-01 04:04:19 +02:00
Přemysl Eric Janouch 93172797e1
Set cursor to child when going to parent dir
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.
2020-09-29 03:39:13 +02:00
Přemysl Eric Janouch 1507f2dff9
Cleanup 2020-09-29 02:31:49 +02:00
Přemysl Eric Janouch 9a12fd8021
Add ability to run helpers externally
So far experimental and essentially undocumented.
2020-09-29 01:33:19 +02:00
Přemysl Eric Janouch f596bb8f5e
reload() doesn't really need to know the old path
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.
2020-09-28 22:52:33 +02:00
Přemysl Eric Janouch 67da8d965b
Make anchor processing a bit more obvious 2020-09-28 22:18:17 +02:00
Přemysl Eric Janouch e60ffeeb20
Improve PAGER defaults
We basically need less(1), nothing else will work correctly.

I'm not sure where I took pager(1) from, might be a Debian thing.
2020-09-28 21:34:09 +02:00
Přemysl Eric Janouch 9a2f6ab5cf
README.adoc: talk about view and edit helpers 2020-09-28 21:26:33 +02:00
Přemysl Eric Janouch 0a66ae4d26
Expand a comment about overstriked underlining 2020-09-28 20:11:38 +02:00
Přemysl Eric Janouch 121d7850fe
Show error output from failed helpers
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.
2020-09-28 20:05:29 +02:00
Přemysl Eric Janouch 98c8dc5b7d
Fix tilde expansion algorithm
In principle correct, in practice completely broken.

I wrongly assumed basic_string::find() would behave like strcspn(),
and also used a nonsensical string index to check for the tilde.
2020-09-28 02:00:29 +02:00
Přemysl Eric Janouch b99f96cf6a
Fix comment: the word "no-op" needs to be split 2020-09-28 01:46:38 +02:00
Přemysl Eric Janouch 5759df156b
Support tilde expansion in the "chdir" action
The tilde may be escaped, and this first escape may be escaped
as well, so all paths should be expressable.

All will just work(TM) for those who need it, and those who start
filenames with backslashes are begging to have their foot shot.

It appears that even Shift JIS, Big5, GB 18030, and GBK are
compatible with Unix paths, meaning they don't redefine the slash
(0x2F), so I'm okay with my direct multibyte string handling in
unknown locales.

Legacy stuff smells.
2020-09-28 01:45:56 +02:00
Přemysl Eric Janouch 91df92f49a
Make F3 change directories
Best complemented with a less(1) configuration that also quits on F3,
just like mcview.  Or invoke sdn with PAGER=mcview, even though you
lose the ability to view the help that way (but gain filters).
2020-09-27 23:33:10 +02:00
Přemysl Eric Janouch bff886841b
Always accept ^? as well as ^H as backspace 2020-09-21 21:15:15 +02:00
Přemysl Eric Janouch ebb444dda1
README: add an example of configuring bindings 2020-09-15 19:36:19 +02:00
Přemysl Eric Janouch da0252ff98
README: make it also work with asciidoctor 2020-09-15 19:31:54 +02:00
Přemysl Eric Janouch 98da5f6d35
Add an action to go to the parent directory 2020-09-15 19:15:30 +02:00
Přemysl Eric Janouch f4eebf59af
README: make listings hswg-compatible 2020-08-28 18:33:08 +02:00
Přemysl Eric Janouch 63982b3754
README: make listings libasciidoc-compatible 2020-08-28 18:30:49 +02:00
Přemysl Eric Janouch d6eaf44aee
README: fix upstream URL 2020-08-28 18:25:32 +02:00
Přemysl Eric Janouch b8344f215c
Name change 2020-08-28 18:23:46 +02:00
Přemysl Eric Janouch 623c4914d1
Work around an infinite loop issue 2020-04-19 22:40:57 +02:00
Přemysl Eric Janouch c0f0328762
README: fix integration snippets
Runs of whitespace used to be smashed together.
2020-02-13 20:33:16 +01:00
Přemysl Eric Janouch 571ec74706
Guard against ^Z in helper programs
Resume them immediately, we are not a shell.
2019-12-09 19:01:16 +01:00
Přemysl Eric Janouch 7cce0cc2fd
Fix change notifications
Another embarrassing 71fbaca regression.
2019-09-27 23:06:12 +02:00
Přemysl Eric Janouch bf38e4e9ea
Position indicator like in vi 2019-09-27 22:38:48 +02:00
Přemysl Eric Janouch 2c847fb4a3
Add actions imitating L/M/H in vi 2019-09-27 21:08:12 +02:00
Přemysl Eric Janouch 296c0cc66f
Fixes for previous commits
".." used to be hidden together with hidden files,
and the symlink patch introduced a compiler warning.
2018-12-09 05:29:59 +01:00
Přemysl Eric Janouch 71fbaca9e5
Embrace paths with symbolic links 2018-12-08 01:41:41 +01:00
Přemysl Eric Janouch 4ce6454ebb
Add Norton Commander-like actions for F3 and F4 2018-12-03 22:05:00 +01:00
Přemysl Eric Janouch 315b662581
Don't show .. in the root directory 2018-12-03 22:04:35 +01:00
Přemysl Eric Janouch 4a2a49312b
Fix formatting 2018-12-03 00:11:00 +01:00
Přemysl Eric Janouch 7174b507d3
Fix crash on unknown groups 2018-12-01 15:57:35 +01:00
Přemysl Eric Janouch aae9c392fa
Also sort symlinks to directories first 2018-11-10 01:32:59 +01:00
Přemysl Eric Janouch fad0d264a5
Support old libstdc++ 4.9
Now sdn can be built under Debian jessie with clang++ and libstdc++.
2018-11-04 19:46:06 +01:00
Přemysl Eric Janouch 473aa8788c
Update README 2018-11-03 17:04:50 +01:00
Přemysl Eric Janouch 85ada4dd2b
Fix build on not-my-system 2018-11-03 15:23:31 +01:00
Přemysl Eric Janouch e6ed7da395
Update README 2018-11-03 15:01:39 +01:00