Compare commits

...

7 Commits

Author SHA1 Message Date
bagas 305693a697 Merge pull request 'chore: group all dependencies in renovate config' (#117) from chore/update-renovate-config into staging
SonarQube Scan / SonarQube Trigger (push) Successful in 3m44s
Tests / Run Tests (pull_request) Successful in 2m5s
Reviewed-on: #117
2026-03-20 14:26:38 +07:00
bagas 685d8b9cd3 chore: group all dependencies in renovate config
Tests / Run Tests (pull_request) Successful in 2m4s
2026-03-20 14:19:06 +07:00
bagas 29403b961a Merge pull request 'feat: upgrade bubbletea, bubbles, and lipgloss to v2' (#116) from feat/upgrade-bubbletea-bubbles-lipgloss-v2 into staging
SonarQube Scan / SonarQube Trigger (push) Successful in 3m44s
Reviewed-on: #116
2026-03-20 14:16:17 +07:00
bagas a3ee50174b fix: capture TERM from PTY request to restore terminal colors on SSH sessions
Tests / Run Tests (pull_request) Successful in 2m4s
SonarQube Scan / SonarQube Trigger (push) Successful in 3m40s
2026-03-20 13:59:41 +07:00
Renovate-Clanker 88149088f0 Merge pull request 'fix(deps): update module github.com/charmbracelet/colorprofile to v0.4.3' (#102) from renovate/github.com-charmbracelet-colorprofile-0.x into main
SonarQube Scan / SonarQube Trigger (push) Successful in 3m55s
2026-03-10 07:04:54 +07:00
Renovate-Clanker 5becded0a2 fix(deps): update module github.com/charmbracelet/colorprofile to v0.4.3
Tests / Run Tests (pull_request) Successful in 2m7s
2026-03-10 00:04:48 +00:00
Renovate-Clanker a25a7cc635 Merge pull request 'fix(deps): update module charm.land/lipgloss/v2 to v2.0.1' (#101) from renovate/charm.land-lipgloss-v2-2.x into main
SonarQube Scan / SonarQube Trigger (push) Successful in 3m34s
2026-03-09 20:09:58 +07:00
5 changed files with 60 additions and 12 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ require (
charm.land/lipgloss/v2 v2.0.1
git.fossy.my.id/bagas/tunnel-please-grpc v1.5.0
github.com/caddyserver/certmagic v0.25.2
github.com/charmbracelet/colorprofile v0.4.2
github.com/charmbracelet/colorprofile v0.4.3
github.com/joho/godotenv v1.5.1
github.com/libdns/cloudflare v0.2.2
github.com/stretchr/testify v1.11.1
+2
View File
@@ -24,6 +24,8 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/charmbracelet/colorprofile v0.4.2 h1:BdSNuMjRbotnxHSfxy+PCSa4xAmz7szw70ktAtWRYrY=
github.com/charmbracelet/colorprofile v0.4.2/go.mod h1:0rTi81QpwDElInthtrQ6Ni7cG0sDtwAd4C4le060fT8=
github.com/charmbracelet/colorprofile v0.4.3 h1:QPa1IWkYI+AOB+fE+mg/5/4HRMZcaXex9t5KX76i20Q=
github.com/charmbracelet/colorprofile v0.4.3/go.mod h1:/zT4BhpD5aGFpqQQqw7a+VtHCzu+zrQtt1zhMt9mR4Q=
github.com/charmbracelet/ultraviolet v0.0.0-20260205113103-524a6607adb8 h1:eyFRbAmexyt43hVfeyBofiGSEmJ7krjLOYt/9CF5NKA=
github.com/charmbracelet/ultraviolet v0.0.0-20260205113103-524a6607adb8/go.mod h1:SQpCTRNBtzJkwku5ye4S3HEuthAlGy2n9VXZnWkEW98=
github.com/charmbracelet/x/ansi v0.11.6 h1:GhV21SiDz/45W9AnV2R61xZMRri5NlLnl6CVF7ihZW8=
+3 -2
View File
@@ -11,8 +11,9 @@
"digest"
],
"automerge": true,
"baseBranchPatterns": [
"staging"
"groupName": "all-dependencies",
"matchPackageNames": [
"*"
]
}
]
+32 -8
View File
@@ -53,6 +53,8 @@ type interaction struct {
cancel context.CancelFunc
mode types.InteractiveMode
programMu sync.Mutex
width int
height int
}
func (i *interaction) SetMode(m types.InteractiveMode) {
@@ -71,8 +73,14 @@ func (i *interaction) Send(message string) error {
return nil
}
func (i *interaction) SetWH(w, h int) {
if i.program != nil {
i.program.Send(tea.WindowSizeMsg{
i.programMu.Lock()
i.width = w
i.height = h
prog := i.program
i.programMu.Unlock()
if prog != nil {
prog.Send(tea.WindowSizeMsg{
Width: w,
Height: h,
})
@@ -158,8 +166,13 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
func (i *interaction) Redraw() {
if i.program != nil {
i.program.Send(tea.WindowSizeMsg{})
i.programMu.Lock()
prog := i.program
w, h := i.width, i.height
i.programMu.Unlock()
if prog != nil {
prog.Send(tea.WindowSizeMsg{Width: w, Height: h})
}
}
@@ -246,18 +259,29 @@ func (i *interaction) Start() {
}
i.programMu.Lock()
i.program = tea.NewProgram(
m,
w, h := i.width, i.height
i.programMu.Unlock()
opts := []tea.ProgramOption{
tea.WithInput(i.channel),
tea.WithOutput(i.channel),
tea.WithColorProfile(colorprofile.TrueColor),
tea.WithoutSignals(),
tea.WithoutSignalHandler(),
tea.WithFPS(30),
)
tea.WithEnvironment([]string{"TERM=xterm-256color", "COLORTERM=truecolor"}),
}
if w > 0 && h > 0 {
opts = append(opts, tea.WithWindowSize(w, h))
}
prog := tea.NewProgram(m, opts...)
i.programMu.Lock()
i.program = prog
i.programMu.Unlock()
_, err := i.program.Run()
_, err := prog.Run()
if err != nil {
log.Printf("Cannot close tea: %s \n", err)
}
+22 -1
View File
@@ -232,13 +232,34 @@ func (s *session) handleWindowChange(req *ssh.Request) error {
return req.Reply(true, nil)
}
func (s *session) handlePtyReq(req *ssh.Request) error {
var ptyPayload struct {
Term string
Width uint32
Height uint32
PxW uint32
PxH uint32
Modes string
}
if err := ssh.Unmarshal(req.Payload, &ptyPayload); err == nil {
if ptyPayload.Width > 0 && ptyPayload.Height > 0 {
s.interaction.SetWH(int(ptyPayload.Width), int(ptyPayload.Height))
}
}
return req.Reply(true, nil)
}
func (s *session) HandleGlobalRequest(GlobalRequest <-chan *ssh.Request) error {
for req := range GlobalRequest {
switch req.Type {
case "shell", "pty-req":
case "shell":
if err := req.Reply(true, nil); err != nil {
return err
}
case "pty-req":
if err := s.handlePtyReq(req); err != nil {
return err
}
case "window-change":
if err := s.handleWindowChange(req); err != nil {
return err