Skip to content

Commit

Permalink
FvwmPrompt: preserve quotes, etc
Browse files Browse the repository at this point in the history
When dealing with input entered into FvwmPrompt, using shell.c.Args meant
that the input had been parsed, which doesn't preserve quotes.  Hence,
the following:

    Exec exec xterm -T "Foo Bar" -e mc

Was parsed as this:

    Exec exec xterm -T Fooo Bar -e mc

Which is not the same thing.

It turns out that ishell preserves the argument list in RawArgs in its
context struct, so use this when parsing input from the user.

Fixes #662
  • Loading branch information
ThomasAdam committed Aug 30, 2023
1 parent 58f2d04 commit 5646361
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/FvwmPrompt/FvwmPrompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func main() {
shell.SetHistoryPath(consoleHistory)

shell.NotFound(func(c *ishell.Context) {
handleInput(c, strings.Join(c.Args, " "), writeToFMD)
handleInput(c, strings.Join(c.RawArgs, " "), writeToFMD)
})

// register a function for overriding Fvwm3's "Quit" command, to
Expand Down

0 comments on commit 5646361

Please sign in to comment.