MCPcopy
hub / github.com/ddworken/hishtory / captureTerminalOutputComplex

Function captureTerminalOutputComplex

client/testutils.go:261–274  ·  view source on GitHub ↗
(t testing.TB, captureConfig TmuxCaptureConfig)

Source from the content-addressed store, hash-verified

259}
260
261func captureTerminalOutputComplex(t testing.TB, captureConfig TmuxCaptureConfig) string {
262 require.NotNil(t, captureConfig.tester)
263 fullCommand := ""
264 fullCommand += buildTmuxInputCommands(t, captureConfig)
265 fullCommand += " tmux capture-pane -t foo -p"
266 if captureConfig.includeEscapeSequences {
267 // -e ensures that tmux runs the command in an environment that supports escape sequences. Used for rendering colors in the TUI.
268 fullCommand += "e"
269 }
270 fullCommand += "\n"
271 fullCommand += " tmux kill-session -t foo\n"
272 testutils.TestLog(t, "Running tmux command: "+fullCommand)
273 return strings.TrimSpace(captureConfig.tester.RunInteractiveShell(t, fullCommand))
274}
275
276func assertNoLeakedConnections(t testing.TB) {
277 resp, err := lib.ApiGet(makeTestOnlyContextWithFakeConfig(), "/api/v1/get-num-connections")

Callers 2

testTui_colorFunction · 0.85

Calls 3

TestLogFunction · 0.92
buildTmuxInputCommandsFunction · 0.85
RunInteractiveShellMethod · 0.65

Tested by 1

testTui_colorFunction · 0.68