Replace newlines with semicolons to fix #34

This commit is contained in:
David Dworken 2022-11-17 23:20:11 -08:00
parent 3a623e6503
commit f53e02731d
No known key found for this signature in database
2 changed files with 3 additions and 1 deletions

View File

@ -2500,3 +2500,5 @@ func FuzzTestMultipleUsers(f *testing.F) {
}
// TODO: somehow test/confirm that hishtory works even if only bash/only zsh is installed
// TODO: TUI tests for multiline commands

View File

@ -228,7 +228,7 @@ func getRows(ctx *context.Context, columnNames []string, query string, numEntrie
if strings.TrimSpace(entry.Command) == strings.TrimSpace(lastCommand) && config.FilterDuplicateCommands {
continue
}
entry.Command = strings.ReplaceAll(entry.Command, "\n", " ") // TODO: handle multi-line commands better here
entry.Command = strings.ReplaceAll(entry.Command, "\n", "; ")
row, err := buildTableRow(ctx, columnNames, *entry)
if err != nil {
return nil, 0, fmt.Errorf("failed to build row for entry=%#v: %v", entry, err)