-
Notifications
You must be signed in to change notification settings - Fork 34
Piping from less into ChromatTerm does not keep less open interactively #74
Comments
I see you've already performed the initial investigation :) Ideally, I've thought of having Anyway, let me fix #75 first as it's more straight forward and then I'll give this the attention it requires. Thanks for opening the issues. I greatly appreciate it. |
I've been working on this and while I do have POC code that fundamentally works, I don't think it's acceptable due to its very risky approach. I've looked at the following options but each has its own drawbacks:
I've also tried combinations of the above, but the code starts looking sketchy. Essentially, I'm trying to
The good news is that I can already do steps 2, 3, and 4 cleanly (as intended). I'm just trying to find the best way – or as close to it as possible – to creating a tty file descriptor that would allow me to make ChromaTerm invisible. I look for a bit more. |
I ran into It would appear the I'll work on making this work. You'll be able to do things like |
TLDR: got it all working; just reviewing the code and writing up tests. Should be done soon. I've put some text in the epilog of
I've written a test script for verifying if the stdin and stdout are tty's from the program's perspective. Here's what normal program looks like when called from within a shell (both are tty's or True):
When piping, a program will have the ability to detect that stdin and/or stdout are not tty's.
When using
If you try to pipe stdin and/or stdout when using
|
Completed in a76a348...a52fe3a. v0.5.2 will be published soon. BTW, I removed the need for |
Thank you very much for your time in fixing this. Can confirm that One little thing to improve: The positional arguments are not listed in the usage explanation line in the help section: -usage: ct [-h] [--config FILE] [--reload] [--rgb] ...
+usage: ct [-h] [--config FILE] [--reload] [--rgb] [program] ...
positional arguments:
program run a program with anything after it used as argument |
Thanks for the suggestion. I’ll add this in for the next version.
I’m using the default help formatter of ArgParse; the help output is auto-generated. The ... is how ArgParse represents a capture-remaining argument. I can, however, add a dedicated argument for the program to make the help output clearer.
… On 21 Oct 2019, at 8:17 am, aaronols ***@***.***> wrote:
Thank you very much for your time in fixing this. Can confirm that less run by chromaterm is now interactive 👍
One little thing to improve: The positional arguments are not listed in the usage explanation line in the help section:
-usage: ct [-h] [--config FILE] [--reload] [--rgb] ...
+usage: ct [-h] [--config FILE] [--reload] [--rgb] [program] ...
positional arguments:
program run a program with anything after it used as argument
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Clarified the help output in 9511bf6. Now it looks like this:
Once more, thank you for the feedback. |
Description
A command of the structure
less file.log | ct
correctly opens the desired file in less and colorizes it.The less program is however not interactive, scrolls through the entire log file and then closes itself.
What do I have to do to keep the less program interactive when piping from less into ct?
I have looked over the man page for less but could not find a flag to force interactive mode or something similar.
Environment
Configuration
This happens with the default configuration
The text was updated successfully, but these errors were encountered: