Documentation
¶
Index ¶
- Constants
- Variables
- func DCSToKitty(msgtype, payload string) (string, error)
- func DownloadFileWithProgress(destpath, url string, kill_if_signaled bool) (err error)
- func ExecAndHoldTillEnter(cmdline []string)
- func FormatPartOfLine(sgr string, start_x, end_x, y int) string
- func HoldTillEnter(start_with_newline bool)
- func InternalHyperlink(text, id string) string
- func KittenOutputSerializer() func(any) (string, error)
- func PrepareRootCmd(root *cli.Command)
- func ReadPassword(prompt string, kill_if_signaled bool) (password string, err error)
- func RenderProgressBar(frac float64, width int) string
- func RepeatChar(char string, count int) string
- func ResolveShell(shell string) []string
- func ResolveShellIntegration(shell_integration string) string
- func RunCommandRestoringTerminalToSaneStateAfter(cmd []string)
- func RunShell(shell_cmd []string, shell_integration_env_var_val, cwd string) (err error)
- type CellRegion
- type KilledBySignal
- type KittyOpts
- type LinePos
- type MouseSelection
- func (self *MouseSelection) Clear()
- func (ms *MouseSelection) DragScroll(ev *loop.MouseEvent, lp *loop.Loop, callback loop.TimerCallback)
- func (ms *MouseSelection) DragScrollTick(timer_id loop.IdType, lp *loop.Loop, callback loop.TimerCallback, ...) error
- func (ms *MouseSelection) EndLine() LinePos
- func (self *MouseSelection) Finish()
- func (self *MouseSelection) IsActive() bool
- func (self *MouseSelection) IsEmpty() bool
- func (ms *MouseSelection) LineBounds(line_pos LinePos) (start_x, end_x int)
- func (ms *MouseSelection) LineFormatSuffix(line_pos LinePos, sgr string, y int) string
- func (ms *MouseSelection) OutOfVerticalBounds(ev *loop.MouseEvent) bool
- func (ms *MouseSelection) StartLine() LinePos
- func (ms *MouseSelection) StartNewSelection(ev *loop.MouseEvent, line LinePos, min_y, max_y, cell_width, cell_height int)
- func (ms *MouseSelection) Update(ev *loop.MouseEvent, line LinePos)
- type MouseState
- func (m *MouseState) AddCellRegion(id string, start_x, start_y, end_x, end_y int, ...) *CellRegion
- func (m *MouseState) ApplyHoverStyles(lp *loop.Loop, style ...string)
- func (m *MouseState) ClearCellRegions()
- func (m *MouseState) ClickHoveredRegions() error
- func (m *MouseState) UpdateHoveredIds() (changed bool)
- func (m *MouseState) UpdateState(ev *loop.MouseEvent) (hovered_ids_changed bool)
- type RenderLines
- type SelectionBoundary
- type Spinner
Constants ¶
View Source
const KittyInternalHyperlinkProtocol = "kitty-ih"
Variables ¶
View Source
var Canceled = errors.New("Canceled by user")
View Source
var RunningAsUI = sync.OnceValue(func() bool { defer func() { os.Unsetenv("KITTEN_RUNNING_AS_UI") }() return os.Getenv("KITTEN_RUNNING_AS_UI") != "" })
View Source
var TmuxAllowPassthrough = sync.OnceValue(tmux_allow_passthrough)
View Source
var TmuxSocketAddress = sync.OnceValue(tmux_socket_address)
Functions ¶
func DCSToKitty ¶
func ExecAndHoldTillEnter ¶
func ExecAndHoldTillEnter(cmdline []string)
func FormatPartOfLine ¶
func HoldTillEnter ¶
func HoldTillEnter(start_with_newline bool)
func InternalHyperlink ¶
func KittenOutputSerializer ¶
func PrepareRootCmd ¶
func ReadPassword ¶
func RenderProgressBar ¶
func RepeatChar ¶
func ResolveShell ¶
func ResolveShellIntegration ¶
func RunCommandRestoringTerminalToSaneStateAfter ¶
func RunCommandRestoringTerminalToSaneStateAfter(cmd []string)
Types ¶
type CellRegion ¶
type CellRegion struct {
TopLeft, BottomRight struct{ X, Y int }
Id string
OnClick []func(id string) error
}
func (CellRegion) Contains ¶
func (c CellRegion) Contains(x, y int) bool
type KilledBySignal ¶
func (*KilledBySignal) Error ¶
func (self *KilledBySignal) Error() string
type MouseSelection ¶
type MouseSelection struct {
// contains filtered or unexported fields
}
func (*MouseSelection) Clear ¶
func (self *MouseSelection) Clear()
func (*MouseSelection) DragScroll ¶
func (ms *MouseSelection) DragScroll(ev *loop.MouseEvent, lp *loop.Loop, callback loop.TimerCallback)
func (*MouseSelection) DragScrollTick ¶
func (ms *MouseSelection) DragScrollTick(timer_id loop.IdType, lp *loop.Loop, callback loop.TimerCallback, do_scroll func(int, *loop.MouseEvent) error) error
func (*MouseSelection) EndLine ¶
func (ms *MouseSelection) EndLine() LinePos
func (*MouseSelection) Finish ¶
func (self *MouseSelection) Finish()
func (*MouseSelection) IsActive ¶
func (self *MouseSelection) IsActive() bool
func (*MouseSelection) IsEmpty ¶
func (self *MouseSelection) IsEmpty() bool
func (*MouseSelection) LineBounds ¶
func (ms *MouseSelection) LineBounds(line_pos LinePos) (start_x, end_x int)
func (*MouseSelection) LineFormatSuffix ¶
func (ms *MouseSelection) LineFormatSuffix(line_pos LinePos, sgr string, y int) string
func (*MouseSelection) OutOfVerticalBounds ¶
func (ms *MouseSelection) OutOfVerticalBounds(ev *loop.MouseEvent) bool
func (*MouseSelection) StartLine ¶
func (ms *MouseSelection) StartLine() LinePos
func (*MouseSelection) StartNewSelection ¶
func (ms *MouseSelection) StartNewSelection(ev *loop.MouseEvent, line LinePos, min_y, max_y, cell_width, cell_height int)
func (*MouseSelection) Update ¶
func (ms *MouseSelection) Update(ev *loop.MouseEvent, line LinePos)
type MouseState ¶
type MouseState struct {
Cell, Pixel struct{ X, Y int }
Pressed struct{ Left, Right, Middle, Fourth, Fifth, Sixth, Seventh bool }
// contains filtered or unexported fields
}
func (*MouseState) AddCellRegion ¶
func (m *MouseState) AddCellRegion(id string, start_x, start_y, end_x, end_y int, on_click ...func(id string) error) *CellRegion
func (*MouseState) ApplyHoverStyles ¶
func (m *MouseState) ApplyHoverStyles(lp *loop.Loop, style ...string)
func (*MouseState) ClearCellRegions ¶
func (m *MouseState) ClearCellRegions()
func (*MouseState) ClickHoveredRegions ¶
func (m *MouseState) ClickHoveredRegions() error
func (*MouseState) UpdateHoveredIds ¶
func (m *MouseState) UpdateHoveredIds() (changed bool)
func (*MouseState) UpdateState ¶
func (m *MouseState) UpdateState(ev *loop.MouseEvent) (hovered_ids_changed bool)
type RenderLines ¶
type RenderLines struct { }
func (RenderLines) InRectangle ¶
func (r RenderLines) InRectangle( lines []string, start_x, start_y, width, height int, mouse_state *MouseState, on_click ...func(id string) error, ) (all_rendered bool, y_after_last_line int, ans string)
Render lines in the specified rectangle. If width > 0 then lines are wrapped to fit in the width. A string containing rendered lines with escape codes to move cursor is returned. Any internal hyperlinks are added to the MouseState.
type SelectionBoundary ¶
type SelectionBoundary struct {
// contains filtered or unexported fields
}
func (*SelectionBoundary) Equal ¶
func (self *SelectionBoundary) Equal(other SelectionBoundary) bool
func (*SelectionBoundary) LessThan ¶
func (self *SelectionBoundary) LessThan(other *SelectionBoundary) bool
Source Files
¶
Click to show internal directories.
Click to hide internal directories.