tui-cs/Terminal.Gui · warning · TimeoutException
Process timed out. Command line: {process.StartInfo.FileName
Error message
Process timed out. Command line: {process.StartInfo.FileName} {process.StartInfo.Arguments}. What it means
Thrown as TimeoutException by ClipboardProcessRunner.Process when the spawned helper process (bash/xclip/xsel/etc.) does not exit within 5000ms. The message includes the command line for diagnosis. This protects the UI thread from hanging indefinitely on an unresponsive clipboard helper.
Source
Thrown at Terminal.Gui/App/Clipboard/ClipboardProcessRunner.cs:65
RedirectStandardInput = true,
UseShellExecute = false,
CreateNoWindow = true
};
process.Start ();
if (!string.IsNullOrEmpty (input))
{
process.StandardInput.Write (input);
process.StandardInput.Close ();
}
if (!process.WaitForExit (5000))
{
var timeoutError =
$@"Process timed out. Command line: {process.StartInfo.FileName} {process.StartInfo.Arguments}.";
throw new TimeoutException (timeoutError);
}
if (waitForOutput && process.StandardOutput.Peek () != -1)
{
output = process.StandardOutput.ReadToEnd ();
}
if (process.ExitCode > 0)
{
output = $@"Process failed to run. Command line: {cmd} {arguments}.
Output: {output}
Error: {process.StandardError.ReadToEnd ()}";
}
return (process.ExitCode, output);
}
}
View on GitHub (pinned to 2e47b11478)
Solutions
- Switch to a clipboard helper that daemonizes the selection, or use xclip with options that avoid holding the selection open.
- Ensure a healthy clipboard daemon / display server is running in the session.
- Catch TimeoutException and fall back to an in-memory clipboard or disable OS clipboard sync.
- Prefer the Try* clipboard methods which do not throw on failure.
Example fix
// before
string text = Application.Driver.Clipboard.GetClipboardData (); // helper hangs -> TimeoutException
// after
if (Application.Driver.Clipboard.TryGetClipboardData (out string text))
{
// use text
}
else
{
// clipboard helper unavailable or timed out; degrade gracefully
} Defensive patterns
Strategy: try-catch
Validate before calling
if (Application.Driver?.Clipboard?.TryGetClipboardData (out string text) == true)
{
// use text — Try* methods do not throw on timeout/unsupported
} Type guard
static bool ClipboardReadSafely (out string text) =>
Application.Driver?.Clipboard?.TryGetClipboardData (out text) == true; Try / catch
try
{
string text = Application.Driver.Clipboard.GetClipboardData ();
}
catch (TimeoutException ex)
{
Logging.Warning ($"Clipboard helper timed out: {ex.Message}");
text = string.Empty;
} Prevention
- Prefer TryGetClipboardData/TrySetClipboardData to avoid throws on timeout.
- Use a clipboard helper that does not hold the selection open (avoid raw xclip over SSH).
- Ensure a responsive clipboard daemon is running in the session.
When it happens
Trigger: The clipboard helper (xclip, xsel, pbcopy/pbpaste, wl-copy/wl-paste, or a bash -c wrapper) hangs — e.g. waiting on an X11 selection that never resolves, a dead clipboard daemon, or a frozen display server; the helper prompting for something interactively that blocks.
Common situations: xclip holding the clipboard selection open until another process claims it (classic xclip behavior over SSH); a stale clipboard manager; a wedged Wayland compositor; slow network filesystems affecting the helper's startup.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- Failed to copy from the OS clipboard.
- Failed to paste to the OS clipboard.
- "{_xclipPath} {xclipArgs}" failed.
- "{_xclipPath} {xclipArgs} < {text}" failed
- Failed to get screenBuffer console mode, error code: {Marsha
AI-assisted analysis of tui-cs/Terminal.Gui@2e47b11478 (2026-08-13).
Data as JSON: /api/errors/4be94fe952f72ab4.
Report an issue: GitHub.