Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to hide output before a certain timeout is reached #161

Open
WaffleLapkin opened this issue Nov 21, 2024 · 4 comments
Open
Labels
configuration Issues about making nom configurable enhancement New feature or request

Comments

@WaffleLapkin
Copy link

I'm writing a program which (among other things) executes nix-build to build a components that needs to be run afterwards. I would like to show users that this program isn't stuck and is just building the component using nom.

This works quite nicely, however, this also always adds a line like Finished at 02:31:03 after 1s to the output. Which is somewhat annoying/confusing for cases when the component build is in the cache and everything finishes in <1s.

I might be able to hack this around on my end, but ideally I want to just set some argument or an environment variable (say NIX_OUTPUT_MONITOR_HIDE_BEFORE=5) which would stop nom from showing output before a certain timeout has passed.

Is this viable? What do you think?

@maralorn
Copy link
Owner

This is absolutely viable and that feature actually exists. Wenn you use nom shell, nom will cleanup after itself. Only problem is, that this internal config option is not exposed via a flag.

@maralorn maralorn added the enhancement New feature or request label Nov 21, 2024
@maralorn
Copy link
Owner

Thinking about it we can even do this more granularly. e.g. only clear the screen when nothing was build or when the build took less than 5s or something like that.

@maralorn maralorn added the configuration Issues about making nom configurable label Nov 23, 2024
@WaffleLapkin
Copy link
Author

@maralorn that sounds great!

Do you think you'll have time and will to implement it anytime soon?

Otherwise, do you have ideas of how this could be implemented / pointers of where to look? I'm far from being well versed in haskell but I could at least try 😅

@maralorn
Copy link
Owner

The problem is that we currently have no proper method of configuration. I would like to have one but there should be a bit of thought in that. Generally I really want to work on this but I can’t currently make promises on when I can get to it.

Besides that this is really easy. Currently there is a boolean called silent in the Config type in Main.hs and you just need to set it to True somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Issues about making nom configurable enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants