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