mkotyk / mintty

Automatically exported from code.google.com/p/mintty
GNU General Public License v3.0
0 stars 0 forks source link

Log to standard output #337

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I've recently added support for mintty in my version of SuperPutty 
(https://github.com/akngo/superputty/tree/mintty_hotkey), and I wonder if it is 
possible to retrieve content from mintty's output.

A feature that I would like to add is to notify the user of recent activity. I 
don't think the log file option would be adequate for this.

Original issue reported on code.google.com by anhk...@gmail.com on 15 May 2012 at 7:59

GoogleCodeExporter commented 8 years ago
After trying a lot of different things, the solution was quite simple. When 
setting the log file (command argument), use a - instead to log to stdout. This 
allows me to detect output of background mintty processes and highlight the tab 
of that process. In the consuming .NET app, I have something along the line of:

m_Process = new Process();
m_Process.EnableRaisingEvents = true;
m_Process.StartInfo.FileName = "path/to/mintty.exe";
m_Process.StartInfo.Arguments = "-l - /bin/bash -l";

// Allows me to retrieve the output
m_Process.StartInfo.RedirectStandardOutput = true;

// For the RedirectStandardOutput to work
m_Process.StartInfo.UseShellExecute = false;

// Handler for data received event
m_Process.OutputDataReceived += m_Process_OutputDataReceived;

Original comment by anhk...@gmail.com on 18 May 2012 at 8:54

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by andy.koppe on 20 May 2012 at 1:43

GoogleCodeExporter commented 8 years ago

Original comment by andy.koppe on 20 May 2012 at 1:44

GoogleCodeExporter commented 8 years ago
Thanks, applied with minor tweaks, in r1274 on trunk.

Original comment by andy.koppe on 23 May 2012 at 5:03

GoogleCodeExporter commented 8 years ago
Looks awesome, nice tweaks :).

Original comment by anhk...@gmail.com on 24 May 2012 at 6:18

GoogleCodeExporter commented 8 years ago

Original comment by andy.koppe on 16 Jun 2012 at 8:29

GoogleCodeExporter commented 8 years ago
Thanks, this actually was exactly what I was trying to figure out for another 
project!

Original comment by gduc...@gmail.com on 7 May 2013 at 4:56