editor process

This commit is contained in:
godo 2024-08-01 19:32:17 +08:00
parent c2dace5281
commit 0a2d55f66a
2 changed files with 7 additions and 0 deletions

View file

@ -50,6 +50,9 @@
- ***支持多平台Windows、Linux、MacOS***
- ***完善的应用商店体系,简单学习一下[应用商店配置](./docs/Store.md)即可开发出复杂的应用***
## 🚀 演示视频
- [全程操作](https://www.bilibili.com/video/BV1NdvaeEEz3/?vd_source=739e0e59aeefdb2e9f760e5037d00245)
## 🚧 开发进程
- 2024年8月1日发布v1.0.0版本,发布后,项目进入第二阶段。

View file

@ -40,6 +40,8 @@ func listAllProcesses() ([]ProcessSystemInfo, error) {
cmd = exec.Command("lsof", "-i", "-n", "-P")
case "windows":
cmd = exec.Command("netstat", "-ano")
cmd = SetHideConsoleCursor(cmd)
default:
return nil, fmt.Errorf("unsupported operating system")
}
@ -122,6 +124,7 @@ func getProcessName(osType string, pid int) (string, error) {
cmd = exec.Command("ps", "-p", strconv.Itoa(pid), "-o", "comm=")
case "windows":
cmd = exec.Command("tasklist", "/FI", fmt.Sprintf("PID eq %d", pid), "/NH")
cmd = SetHideConsoleCursor(cmd)
default:
return "", fmt.Errorf("unsupported operating system")
}
@ -156,6 +159,7 @@ func killProcessByName(name string) error {
cmd = exec.Command("pkill", name)
case "windows":
cmd = exec.Command("taskkill", "/IM", name, "/F") // /F 表示强制结束
cmd = SetHideConsoleCursor(cmd)
default:
return fmt.Errorf("unsupported operating system")
}