Add eslogger completion and Go tools

This commit is contained in:
tke
2026-03-07 10:32:52 +01:00
parent 412f812fe2
commit cf17b37a7d
11 changed files with 561 additions and 0 deletions

5
tools/go/gopname/go.mod Normal file
View File

@@ -0,0 +1,5 @@
module pname
go 1.24.4
require github.com/erikdubbelboer/gspt v0.0.0-20210805194459-ce36a5128377

2
tools/go/gopname/go.sum Normal file
View File

@@ -0,0 +1,2 @@
github.com/erikdubbelboer/gspt v0.0.0-20210805194459-ce36a5128377 h1:gT+RM6gdTIAzMT7HUvmT5mL8SyG8Wx7iS3+L0V34Km4=
github.com/erikdubbelboer/gspt v0.0.0-20210805194459-ce36a5128377/go.mod h1:v6o7m/E9bfvm79dE1iFiF+3T7zLBnrjYjkWMa1J+Hv0=

29
tools/go/gopname/pname.go Normal file
View File

@@ -0,0 +1,29 @@
package main
import (
"fmt"
"os"
"os/exec"
"github.com/erikdubbelboer/gspt" // Import the new library
)
func main() {
// Change the process title using the library
gspt.SetProcTitle("notmyname")
fmt.Println("Process name changed. Press any key to exit...")
// Disable input buffering
exec.Command("stty", "-F", "/dev/tty", "cbreak", "min", "1").Run()
// Do not display entered characters on the screen
exec.Command("stty", "-F", "/dev/tty", "-echo").Run()
var b []byte = make([]byte, 1)
os.Stdin.Read(b)
// Restore the original terminal settings
exec.Command("stty", "-F", "/dev/tty", "sane").Run()
fmt.Println("\nKey pressed. Exiting.")
}