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
Improve log (-l) option to accept Putty like &Y, &M &D &T "variables" #546
Comments
I understand you basically want a timestamp. Rather than handling %Y etc individually, what about either a simpler or more generic option:
Also, I was thinking about an option to toggle logging within the mintty session from the popup menu (like in xterm); would that be useful, too? |
That would be perfect! Although I personally don't like %D as a timestamp due to ":" being a special character in a few shells which adds escaping it, it achieves the main objective, and for someone getting started is simple and easy, thus great. But then when you add the possibility of strftime() that covers it all. I didn't want to ask for something like that as I wanted to keep it simple to implement but using strftime() format is actually simpler, great call! And the menu option is the ultimate improvement. When I think of it:
Overall, just brilliant if you are able to implement it like you said. 😊 |
Actually, the typical approach for a number of more special settings is that they can be configured in .minttyrc (and it can already, |
Released in 2.3.6. See manual page for details. |
With 2.7.5, logging can be toggled from extended context menu. |
Awesome! Gotta check it out Monday as soon as I'm back at work! Thank you!!! |
Hi,
Working with Mintty is awesome, it is my current terminal of choice and everything works with Cygwin as I currently need, except for one thing: terminal logging.
More often than not I trace back previous activities and logging is imperative for my sessions. However, Mintty only accepts a %d option for the process number, which doesn't allow for much customization.
Therefore, I would like to request an improvement which is to allow "-l" to accept variables for Year, Month, Day, Time or Hour, Minute, Second and any additional variables you would see value to have so one could create unique log files given a certain string.
Something like:
-l "log %Y%M%D_%H%M%S.log"
is what I would suggest.Alternatives I looked at:
l=log\ $(date +%Y%m%d_%H%M%S).log
followed byexec -l >> >(tee "$l") 2>> >(tee "$l")
in .bash_profile does the trick, at the cost of two additional bash and tee processes (4 in total) plus the annoyance of not being in a terminal properly per say, thus having issues with "vi" and terminal size based utilities like "less" and "more"mintty -l "%USERPROFILE%\Documents\Shell Logs\bash %date:~10,4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2%.log"
in it which works, but has the extra popup whenever I trigger it and is far from elegantThank you!
The text was updated successfully, but these errors were encountered: