Skip to content

Commit f835441

Browse files
authored
fix wsh output. all output is run through sprintf, so escape properly (#971)
1 parent f05032b commit f835441

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

cmd/wsh/cmd/wshcmd-getmeta.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ func getMetaRun(cmd *cobra.Command, args []string) {
5555
return
5656
}
5757
outStr := string(outBArr)
58-
WriteStdout(outStr + "\n")
58+
WriteStdout("%s\n", outStr)
5959
} else {
6060
outBArr, err := json.MarshalIndent(resp, "", " ")
6161
if err != nil {
6262
WriteStderr("[error] formatting metadata: %v\n", err)
6363
return
6464
}
6565
outStr := string(outBArr)
66-
WriteStdout(outStr + "\n")
66+
WriteStdout("%s\n", outStr)
6767
}
6868
}

cmd/wsh/cmd/wshcmd-readfile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ func runReadFile(cmd *cobra.Command, args []string) {
4949
WriteStderr("[error] decoding file: %v\n", err)
5050
return
5151
}
52-
WriteStdout(string(resp))
52+
WriteStdout("%s", string(resp))
5353
}

cmd/wsh/cmd/wshcmd-shell-unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var shellCmd = &cobra.Command{
2525
Hidden: true,
2626
Short: "Print the login shell of this user",
2727
Run: func(cmd *cobra.Command, args []string) {
28-
WriteStdout(shellCmdInner())
28+
WriteStdout("%s", shellCmdInner())
2929
},
3030
}
3131

cmd/wsh/cmd/wshcmd-version.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
package cmd
55

66
import (
7-
"fmt"
8-
97
"github.com/spf13/cobra"
108
"github.com/wavetermdev/waveterm/pkg/wavebase"
119
)
@@ -18,6 +16,6 @@ var versionCmd = &cobra.Command{
1816
Use: "version",
1917
Short: "Print the version number of wsh",
2018
Run: func(cmd *cobra.Command, args []string) {
21-
WriteStdout(fmt.Sprintf("wsh v%s\n", wavebase.WaveVersion))
19+
WriteStdout("wsh v%s\n", wavebase.WaveVersion)
2220
},
2321
}

pkg/wconfig/defaultconfig/presets.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,13 @@
8686
"bg": "linear-gradient(135deg, rgba(204, 51, 255, 0.9) 0%, rgba(255, 85, 153, 0.75) 30%, rgba(255, 51, 153, 0.65) 60%, rgba(204, 51, 255, 0.6) 80%, rgba(51, 102, 255, 0.5) 100%), radial-gradient(circle at 30% 40%, rgba(255,255,255,0.1), transparent 60%), radial-gradient(circle at 70% 70%, rgba(255,255,255,0.05), transparent 70%)",
8787
"bg:opacity": 0.9,
8888
"bg:blendmode": "overlay"
89+
},
90+
"bg@twilight-ember": {
91+
"display:name": "Twilight Ember",
92+
"display:order": 3.5,
93+
"bg:*": true,
94+
"bg": "linear-gradient(120deg,hsla(350, 65%, 57%, 1),hsla(30,60%,60%, .75), hsla(208,69%,50%,.15), hsl(230,60%,40%)),radial-gradient(at top right,hsla(300,60%,70%,0.3),transparent),radial-gradient(at top left,hsla(330,100%,70%,.20),transparent),radial-gradient(at top right,hsla(190,100%,40%,.20),transparent),radial-gradient(at bottom left,hsla(323,54%,50%,.5),transparent),radial-gradient(at bottom left,hsla(144,54%,50%,.25),transparent)",
95+
"bg:blendmode": "overlay",
96+
"bg:text": "rgb(200, 200, 200)"
8997
}
9098
}

0 commit comments

Comments
 (0)