nextflow icon indicating copy to clipboard operation
nextflow copied to clipboard

Configurable output width in non-interactive scenarios

Open Poshi opened this issue 7 months ago • 2 comments

New feature

Configurable output width in non-interactive scenarios.

Use case

When you run nextflow in a non-interactive scenario, like a batch scheduler, the ANSI output is constrained to a default value of 80 columns. That causes long process names to be truncated up to the point of being non recognizable. Being able to externally supply the desired column width would solve this issue.

This is interesting to be able to have an overview of the execution by looking at the log files. Easily seeing which processes are already finished and which percentage of execution are the ones that are not yet finished. Disabling ansi output do not work for this purposes, as then you have the information about the jobs started, but not how many are there or which is their execution percentage :-(

Suggested implementation

I would internally adjust the calls to jline->stty -a to previously recognize if the terminal exists. If it exists, honor the stty return values; if not, use user provided values (by parameter, environment variable (COLUMNS?)...) I'm not sure if terminal.isAttached() would be the most appropriate call for this duty, I never worked with jline, but it sems a good method to try.

stty return 80 columns (and 24 rows) by default when there's no sensible value.

Poshi avatar Jun 06 '25 09:06 Poshi

wouldn't you want to disable the ansi logging in this case anyway?

bentsherman avatar Jun 06 '25 13:06 bentsherman

Well, I don't need colors for that output, but I need the standard ANSI logging format: periodic dump of general state, in particular, list of processes with how many instances finished, how many have been started and the percentage (per process). AFAIK, when disabling the ANSI logging I just get when the processes start and stops, but not the totals.

Poshi avatar Jun 06 '25 14:06 Poshi