Closed peti634 closed 1 year ago
Hi.
I didn't quite get how to reproduce the bug, can you explain further?
Yes, of course, here is the short example:
package main
import (
"fmt"
"os"
"github.com/ncruces/zenity"
)
func main() {
currentDir, _ := os.Getwd()
saveFilePath, err := zenity.SelectFileSave(
zenity.ConfirmOverwrite(),
zenity.Filename(currentDir+"/map/"),
zenity.FileFilters{{Name: "Map data file (*.txt)", Patterns: []string{"*.txt"}, CaseFold: false}})
fmt.Print(saveFilePath, err)
}
I test it just now, and the issue is same (without my fix).
Other information that could help: go version go1.19 linux/amd64 Linux 5.15.0-69-generic Ubuntu 20.04 VS Code: 1.77.2
I couldn't repro, but the fix seems harmless anyway.
If call like this: exec.Command("zenity", "--file-selection", "--file-filter=Map data file (.txt)|.txt ") (so there is extra char at the end!!) There is nothing happen, so return a error!
But If I call this: exec.Command("zenity", "--file-selection", "--file-filter=Map data file (.txt)|.txt") Without extra char, then works!
Is it different on your side? :o
My zenity version: 3.32.0, so it is the latest
Yes, no error.
My zenity
version is 3.43.0
(the latest on my package manager), maybe that's the difference.
Indeed, thank you!
Bye
Fix released. Thanks!
Hi.
I use this repo for my project with VS Code IDE on Linux. When I add a Pattern to SelectFile dialog, its not appearing, just drop a error: dialog canceled
I have found the issue, in the initFilters function add an extra character to the end of string.
I added a fix - avoid a new space char to end - and everything is okay:
(You can't reproduce the issue, if run it with "go run" or "go build", just when debugging, I don't know why)
Bye