darcs

Patch 1281 resolve issue2385: invoke pager without temporary file

Title resolve issue2385: invoke pager without temporary file
Superseder Nosy List gh
Related Issues
Status accepted Assigned To
Milestone 2.10.0

Created on 2015-02-13.17:48:28 by gh, last changed 2015-02-21.21:39:27 by gh.

Files
File name Status Uploaded Type Edit Remove
patch-preview.txt gh, 2015-02-13.17:48:27 text/x-darcs-patch
resolve-issue2385_-invoke-pager-without-temporary-file.dpatch gh, 2015-02-13.17:48:28 application/x-darcs-patch
unnamed gh, 2015-02-13.17:48:28
See mailing list archives for discussion on individual patches.
Messages
msg18130 (view) Author: gh Date: 2015-02-13.17:48:28
Contrary to the patch I attached on the page of issue2385 , this
one does not bump the dependency of process. So it does not
use the delegate_ctlc option of process > 1.2.

The effect of this patch is that "darcs log" is practically instant.
However until we require process > 1.2.2, the pager will be
ctrl-c'able and in this case it will not exit cleanly: for
instance interrupting "less" will launch "more" instead of
just leaving.

1 patch for repository http://darcs.net:

patch 8baa834400e7867e86b6f0ba50773c876956d5c8
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date:   Thu Feb 12 20:57:43 ART 2015
  * resolve issue2385: invoke pager without temporary file
Attachments
msg18132 (view) Author: bfrk Date: 2015-02-13.18:14:49
Good work, I am all for it.

Setting the milestone to 2.10 because it fixes a performance regression
w.r.t. 2.8.4.

The refactoring around the new WhereToPipe data type and the new
pipeDocToPager function makes the code very clear, a definite improvement.

The small remaining problem is not a show-stopper: with 'less' you can
use 'q' to quit, I think most people know that by now. One question
though (just out of interest): what happens if I Ctrl-C again (and
again...)?

(Disclaimer: have not yet applied and tested myself).
msg18143 (view) Author: gh Date: 2015-02-17.22:38:41
What happens on CTRL-C is that both the pager and darcs are killed.
There is a displeasant moment when the output of the killed pager is
still displayed in the terminal, and the terminal gets resetted to its
previous output after you hit any key.
msg18150 (view) Author: bfrk Date: 2015-02-18.08:47:56
This might depend on how you have configured the pager (less). I have
"export LESS=-FX" in my shell init scripts because for me, restoring the
screen defeats the purpose of a pager: I want to be able to scroll back
my terminal to look at the output again after I have quit.

However, there is still something strange happening: I do get back the
prompt immediately but as soon as I hit the next key, the prompt gets
overwritten with a last line of the output from the pager; and the key
gets swallowed. Could this be a (line) buffering problem? Will try to
set to no buffering and see if it helps.
msg18178 (view) Author: bfrk Date: 2015-02-19.23:53:08
See patch1293 for a fix for the strange behavior.
msg18204 (view) Author: gh Date: 2015-02-21.21:39:27
Self accept (with Ben's less -K patch).
History
Date User Action Args
2015-02-13 17:48:28ghcreate
2015-02-13 17:54:04ghsetstatus: needs-screening -> needs-review
2015-02-13 18:14:49bfrksetmessages: + msg18132
milestone: 2.10.0
2015-02-17 22:38:41ghsetmessages: + msg18143
2015-02-18 08:47:56bfrksetmessages: + msg18150
2015-02-19 23:53:08bfrksetmessages: + msg18178
2015-02-21 21:39:27ghsetstatus: needs-review -> accepted
messages: + msg18204