moar icon indicating copy to clipboard operation
moar copied to clipboard

why exit when exit from $EDITOR?

Open qbai opened this issue 1 year ago • 3 comments

when I moar a.sh then click v to edit file, after I click key to exit my editor, it always exit moar together. I remember that less only return itself when exiting editor. my question is how to stay in moar after clicking exit key in editor? thanks a lot

qbai avatar Jul 31 '24 03:07 qbai

Try this:

  1. bash -c "while true ; do date ; sleep 1 ; done" | moar
  2. Inside of moar, press v to launch your editor
  3. Replace everything with hello
  4. Exit your editor

In your opinion, what should moar display now?

  1. The original stream of constantly updating timestamps?
  2. hello from your edits?

For reference, in less (at least the version that ships with macOS) this is handled by just not accepting v when the input is a stream.

walles avatar Aug 01 '24 05:08 walles

@walles thanks your feedback. you could try less [file] then click v, edit something then exit . check what is looks like? less always stay there to show all content edited. I think this should be better way than moar. you agree?

qbai avatar Aug 03 '24 00:08 qbai

Kindly try my example and tell me what you think moar should show after the editor is done.

walles avatar Aug 03 '24 05:08 walles

Kindly answer my questions from https://github.com/walles/moar/issues/231#issuecomment-2262078749 and re-open this ticket @qbai.

Closing while awaiting your response.

walles avatar Sep 07 '24 19:09 walles