restart

package
v1.3.46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecSelf added in v1.3.8

func ExecSelf(binary string, args []string, env []string) error

ExecSelf replaces the current process with a new invocation of the same binary. This is the Unix implementation using syscall.Exec which keeps the same PID and terminal control. Must be called after the TUI has released the terminal.

func Launch

func Launch(req Request) error

Launch writes a self-deleting helper script to /tmp and starts it. The caller should then initiate its own graceful shutdown (e.g. set quitting=true and return tea.Quit).

The helper script waits for the current process (PID) to fully exit before launching the new one.

func ResolveBinary

func ResolveBinary() (string, error)

ResolveBinary returns the path to the ggcode binary that should be used for restart. It resolves symlinks so npm/python wrappers point to the latest installed version.

Types

type Request

type Request struct {
	// Binary is the path to the ggcode binary to launch.
	Binary string
	// Args are the CLI arguments for the new process (e.g. --resume, --config).
	Args []string
	// WorkDir is the working directory for the new process.
	WorkDir string
	// PID is the current process PID (the script waits for it to exit).
	PID int
}

Request contains all info needed to re-launch after exit.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL