You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to propose the addition of support for CONSOLE_WIDTH and CONSOLE_HEIGHT environment variables, especially when a program is invoked by another program. This could be achieved through an IProfileEnricher implementation, which would allow dynamic adjustment of the console size based on these variables.
Here's a potential way to implement this:
using Spectre.Console;using System.Collections.Generic;namespace Apro.AutoUpdater.Cli.Spectre
{publicclassConsoleSizeEnricher:IProfileEnricher{publicstringName=>"ConsoleSizeEnricher";publicboolEnabled(IDictionary<string,string>environmentVariables){// This implementation assumes that the enricher is enabled if// the environment variables "CONSOLE_WIDTH" or "CONSOLE_HEIGHT" are set.return environmentVariables.ContainsKey("CONSOLE_WIDTH")|| environmentVariables.ContainsKey("CONSOLE_HEIGHT");}publicvoidEnrich(Profileprofile){if(environmentVariables.TryGetValue("CONSOLE_WIDTH",outvar width)&&int.TryParse(width,outvar w)){
profile.Width =w;}if(environmentVariables.TryGetValue("CONSOLE_HEIGHT",outvar height)&&int.TryParse(height,outvar h)){
profile.Height =h;}}}}
In addition, it might be beneficial to increase the default maximum line length in CI/CD environments (like GitHub Actions, Bitbucket, etc.) to optimize space utilization and improve readability.
I would appreciate any thoughts or feedback on this proposal.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'd like to propose the addition of support for
CONSOLE_WIDTH
andCONSOLE_HEIGHT
environment variables, especially when a program is invoked by another program. This could be achieved through anIProfileEnricher
implementation, which would allow dynamic adjustment of the console size based on these variables.Here's a potential way to implement this:
In addition, it might be beneficial to increase the default maximum line length in CI/CD environments (like GitHub Actions, Bitbucket, etc.) to optimize space utilization and improve readability.
I would appreciate any thoughts or feedback on this proposal.
Beta Was this translation helpful? Give feedback.
All reactions