Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecRestart ¶ added in v1.3.76
ExecRestart replaces the current process in-place using syscall.Exec. No child process is spawned — the same PID continues with a fresh image. This avoids the orphaned process group problem that causes EIO on terminal raw mode entry.
For /update: the caller must call update.Service.ApplyBinary() BEFORE calling this function. ApplyBinary atomically replaces the binary files (temp-file + rename). On Unix the running process holds the old inode, so syscall.Exec then loads the new file at the same path.
Must be called AFTER the TUI has released the terminal (program.Run() has returned and terminal is restored to cooked mode).
func ExecSelf ¶ added in v1.3.8
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 ¶
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 ¶
ResolveBinary returns the path to the ggcode binary.
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.