Trim any trailing newlines or carriage returns in show output
* Trim any trailing newlines or carriage returns in show output
* TrimRight only
I reduced this to trimming trailing \n's or \r's in case leading
whitespace is part of the password.
@@ -3,6 +3,7 @@ package action
import (
"fmt"
"os"
+ "strings"
"github.com/atotto/clipboard"
"github.com/fatih/color"
@@ -91,7 +92,7 @@ func (s *Action) show(c *cli.Context, name, key string, clip, force, qr bool) er
}
}
- fmt.Println(color.YellowString(string(content)))
+ fmt.Println(color.YellowString(strings.TrimRight(string(content), "\r\n")))
return nil
}
