Skip to content

Windows version pops up a cmd window when the arp command is run #8

@brucealthompson

Description

@brucealthompson

I am using this package with the fyne UI toolkit. When the arp command is execured via exec() it pops up a command window that goes away after the arp command is run. To resolve this issue, the following command must be run before doing the exec():
syscall.SysProcAttr{HideWindow: true}

The following snippet should fix the issue:
func Table() ArpTable {
cmd := exec.Command("arp", "-a")
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
var outb bytes.Buffer
cmd.Stdout = &outb
err := cmd.Run()
data := outb.String()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions