diff --git a/client/client_test.go b/client/client_test.go index d52e497..8de1580 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -1869,6 +1869,18 @@ func testControlR(t *testing.T, tester shellTester, shellName string) { } compareGoldens(t, out, "testControlR-AdvancedSearch") + // Set some different columns to be displayed and check that the table displays those + tester.RunInteractiveShell(t, `hishtory config-set displayed-columns Hostname 'Exit Code' Command`) + out = captureTerminalOutputWithShellName(t, tester, shellName, []string{"C-R"}) + out = strings.TrimSpace(out) + if tester.ShellName() == "bash" { + if !strings.Contains(out, "\n\n\n") { + t.Fatalf("failed to find separator in %#v", out) + } + out = strings.TrimSpace(strings.Split(out, "\n\n\n")[1]) + } + compareGoldens(t, out, "testControlR-CustomColumns") + // Disable control-r _, _ = tester.RunInteractiveShellRelaxed(t, `hishtory config-set enable-control-r false`) // And it shouldn't pop up diff --git a/client/lib/goldens/testControlR-CustomColumns b/client/lib/goldens/testControlR-CustomColumns new file mode 100644 index 0000000..3782ae8 --- /dev/null +++ b/client/lib/goldens/testControlR-CustomColumns @@ -0,0 +1,26 @@ +Search Query: > ls + +┌────────────────────────────────────────────────────┐ +│ Hostname Exit Code Command │ +│────────────────────────────────────────────────────│ +│ localhost 2 echo 'bar' & │ +│ localhost 2 echo 'aaaaaa bbbb' │ +│ localhost 2 ls ~/bar/ │ +│ localhost 2 ls ~/foo/ │ +│ server 127 ls ~/ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────┘ \ No newline at end of file