mirror of
https://github.com/makew0rld/amfora.git
synced 2024-11-03 02:37:23 -05:00
parent
2ae6f6f3a1
commit
40865f977e
@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Fixed
|
||||
- Modal can't be closed when opening non-gemini text URLs from the commandline (#283, #284)
|
||||
- External programs started by Amfora remain as zombie processes (#219)
|
||||
|
||||
|
||||
## [1.9.2] - 2021-12-10
|
||||
|
@ -191,6 +191,7 @@ func open(u string, resp *gemini.Response) {
|
||||
Error("File Opening Error", "Error executing custom command: "+err.Error())
|
||||
return
|
||||
}
|
||||
go proc.Wait() // Prevent zombies, see #219
|
||||
Info("Opened with " + cmd[0])
|
||||
return
|
||||
}
|
||||
@ -214,11 +215,13 @@ func open(u string, resp *gemini.Response) {
|
||||
Info("Opened in default system viewer")
|
||||
} else {
|
||||
cmd := mediaHandler.Cmd
|
||||
err := exec.Command(cmd[0], append(cmd[1:], path)...).Start()
|
||||
proc := exec.Command(cmd[0], append(cmd[1:], path)...)
|
||||
err := proc.Start()
|
||||
if err != nil {
|
||||
Error("File Opening Error", "Error executing custom command: "+err.Error())
|
||||
return
|
||||
}
|
||||
go proc.Wait() // Prevent zombies, see #219
|
||||
Info("Opened with " + cmd[0])
|
||||
}
|
||||
App.Draw()
|
||||
|
@ -48,16 +48,18 @@ func handleHTTP(u string, showInfo bool) bool {
|
||||
}
|
||||
|
||||
// Custom command
|
||||
var err error
|
||||
var proc *exec.Cmd
|
||||
if len(config.HTTPCommand) > 1 {
|
||||
err = exec.Command(config.HTTPCommand[0], append(config.HTTPCommand[1:], u)...).Start()
|
||||
proc = exec.Command(config.HTTPCommand[0], append(config.HTTPCommand[1:], u)...)
|
||||
} else {
|
||||
err = exec.Command(config.HTTPCommand[0], u).Start()
|
||||
proc = exec.Command(config.HTTPCommand[0], u)
|
||||
}
|
||||
err := proc.Start()
|
||||
if err != nil {
|
||||
Error("HTTP Error", "Error executing custom browser command: "+err.Error())
|
||||
return false
|
||||
}
|
||||
go proc.Wait() // Prevent zombies, see #219
|
||||
Info("Opened with: " + config.HTTPCommand[0])
|
||||
|
||||
App.Draw()
|
||||
@ -104,15 +106,17 @@ func handleOther(u string) {
|
||||
|
||||
// Custom application command
|
||||
|
||||
var err error
|
||||
var proc *exec.Cmd
|
||||
if len(handler) > 1 {
|
||||
err = exec.Command(handler[0], append(handler[1:], u)...).Start()
|
||||
proc = exec.Command(handler[0], append(handler[1:], u)...)
|
||||
} else {
|
||||
err = exec.Command(handler[0], u).Start()
|
||||
proc = exec.Command(handler[0], u)
|
||||
}
|
||||
err := proc.Start()
|
||||
if err != nil {
|
||||
Error("URL Error", "Error executing custom command: "+err.Error())
|
||||
}
|
||||
go proc.Wait() // Prevent zombies, see #219
|
||||
Info("Opened with: " + handler[0])
|
||||
App.Draw()
|
||||
}
|
||||
|
@ -7,9 +7,11 @@ import "os/exec"
|
||||
|
||||
// Open opens `path` in default system viewer.
|
||||
func Open(path string) (string, error) {
|
||||
err := exec.Command("open", path).Start()
|
||||
proc := exec.Command("open", path)
|
||||
err := proc.Start()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
go proc.Wait() // Prevent zombies, see #219
|
||||
return "Opened in default system viewer", nil
|
||||
}
|
||||
|
@ -25,9 +25,11 @@ func Open(path string) (string, error) {
|
||||
case xdgOpenNotFoundErr == nil:
|
||||
// Use start rather than run or output in order
|
||||
// to make application run in background.
|
||||
if err := exec.Command(xdgOpenPath, path).Start(); err != nil {
|
||||
proc := exec.Command(xdgOpenPath, path)
|
||||
if err := proc.Start(); err != nil {
|
||||
return "", err
|
||||
}
|
||||
go proc.Wait() // Prevent zombies, see #219
|
||||
return "Opened in default system viewer", nil
|
||||
default:
|
||||
return "", fmt.Errorf("could not determine default system viewer. " +
|
||||
|
@ -8,9 +8,11 @@ import "os/exec"
|
||||
|
||||
// Open opens `path` in default system vierwer.
|
||||
func Open(path string) (string, error) {
|
||||
err := exec.Command("rundll32", "url.dll,FileProtocolHandler", path).Start()
|
||||
proc := exec.Command("rundll32", "url.dll,FileProtocolHandler", path)
|
||||
err := proc.Start()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
go proc.Wait() // Prevent zombies, see #219
|
||||
return "Opened in default system viewer", nil
|
||||
}
|
||||
|
@ -7,9 +7,11 @@ import "os/exec"
|
||||
|
||||
// Open opens `url` in default system browser.
|
||||
func Open(url string) (string, error) {
|
||||
err := exec.Command("open", url).Start()
|
||||
proc := exec.Command("open", url)
|
||||
err := proc.Start()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
go proc.Wait() // Prevent zombies, see #219
|
||||
return "Opened in system default web browser", nil
|
||||
}
|
||||
|
@ -34,14 +34,18 @@ func Open(url string) (string, error) {
|
||||
case xdgOpenNotFoundErr == nil: // Prefer xdg-open over $BROWSER
|
||||
// Use start rather than run or output in order
|
||||
// to make browser running in background.
|
||||
if err := exec.Command(xdgOpenPath, url).Start(); err != nil {
|
||||
proc := exec.Command(xdgOpenPath, url)
|
||||
if err := proc.Start(); err != nil {
|
||||
return "", err
|
||||
}
|
||||
go proc.Wait() // Prevent zombies, see #219
|
||||
return "Opened in system default web browser", nil
|
||||
case envBrowser != "":
|
||||
if err := exec.Command(envBrowser, url).Start(); err != nil {
|
||||
proc := exec.Command(envBrowser, url)
|
||||
if err := proc.Start(); err != nil {
|
||||
return "", err
|
||||
}
|
||||
go proc.Wait() // Prevent zombies, see #219
|
||||
return "Opened in system default web browser", nil
|
||||
default:
|
||||
return "", fmt.Errorf("could not determine system browser")
|
||||
|
@ -8,9 +8,11 @@ import "os/exec"
|
||||
|
||||
// Open opens `url` in default system browser.
|
||||
func Open(url string) (string, error) {
|
||||
err := exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
|
||||
proc := exec.Command("rundll32", "url.dll,FileProtocolHandler", url)
|
||||
err := proc.Start()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
go proc.Wait() // Prevent zombies, see #219
|
||||
return "Opened in system default web browser", nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user