Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process-compose crashes when clicking the horizontal divider #186

Closed
2 tasks done
smeijer opened this issue May 17, 2024 · 3 comments
Closed
2 tasks done

process-compose crashes when clicking the horizontal divider #186

smeijer opened this issue May 17, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@smeijer
Copy link

smeijer commented May 17, 2024

Defect

When clicking the border that lists the current selected process, process-compose crashes.

process-compose.mp4
process-compose up
panic: runtime error: index out of range [-1] [recovered]
	panic: runtime error: index out of range [-1]

goroutine 11 [running]:
github.com/rivo/tview.(*Application).Run.func1()
	/home/eugene/go/pkg/mod/github.com/rivo/tview@v0.0.0-20240307173318-e804876934a1/application.go:285 +0x4c
panic({0x102a314a0?, 0x14000440168?})
	/usr/lib/go-1.22/src/runtime/panic.go:770 +0x124
github.com/f1bonacc1/process-compose/src/tui.(*LogView).MouseHandler.(*TextView).MouseHandler.func1(0x3, 0x0?, 0x14000042160)
	/home/eugene/go/pkg/mod/github.com/rivo/tview@v0.0.0-20240307173318-e804876934a1/textview.go:1386 +0x2e8
github.com/f1bonacc1/process-compose/src/tui.(*LogView).MouseHandler.(*TextView).MouseHandler.(*Box).WrapMouseHandler.func2(0x6000?, 0x1029f83e0?, 0x14000047b01?)
	/home/eugene/go/pkg/mod/github.com/rivo/tview@v0.0.0-20240307173318-e804876934a1/box.go:226 +0x64
github.com/rivo/tview.(*Grid).MouseHandler.func1(0x3, 0x1400027ccc0, 0x14000042160)
	/home/eugene/go/pkg/mod/github.com/rivo/tview@v0.0.0-20240307173318-e804876934a1/grid.go:659 +0xf0
github.com/rivo/tview.(*Grid).MouseHandler.(*Box).WrapMouseHandler.func2(0xe000?, 0x14000075b08?, 0x14000042160?)
	/home/eugene/go/pkg/mod/github.com/rivo/tview@v0.0.0-20240307173318-e804876934a1/box.go:226 +0x64
github.com/rivo/tview.(*Pages).MouseHandler.func1(0x3, 0x1400027ccc0, 0x14000042160)
	/home/eugene/go/pkg/mod/github.com/rivo/tview@v0.0.0-20240307173318-e804876934a1/pages.go:294 +0xf8
github.com/rivo/tview.(*Pages).MouseHandler.(*Box).WrapMouseHandler.func2(0xcf00?, 0x30000007d?, 0x14000047bd8?)
	/home/eugene/go/pkg/mod/github.com/rivo/tview@v0.0.0-20240307173318-e804876934a1/box.go:226 +0x64
github.com/rivo/tview.(*Application).fireMouseActions.func1(0x6500?)
	/home/eugene/go/pkg/mod/github.com/rivo/tview@v0.0.0-20240307173318-e804876934a1/application.go:522 +0x1a4
github.com/rivo/tview.(*Application).fireMouseActions(0x14000278000, 0x1400027ccc0)
	/home/eugene/go/pkg/mod/github.com/rivo/tview@v0.0.0-20240307173318-e804876934a1/application.go:559 +0x24c
github.com/rivo/tview.(*Application).Run(0x14000278000)
	/home/eugene/go/pkg/mod/github.com/rivo/tview@v0.0.0-20240307173318-e804876934a1/application.go:458 +0x4d8
github.com/f1bonacc1/process-compose/src/tui.SetupTui({0x102a96820?, 0x140003e52c0?}, {0x14000047f70, 0x3, 0x0?})
	/home/eugene/projects/go/process-compose/src/tui/view.go:482 +0x158
github.com/f1bonacc1/process-compose/src/cmd.startTui({0x102a96820, 0x140003e52c0})
	/home/eugene/projects/go/process-compose/src/cmd/project_runner.go:94 +0x188
created by github.com/f1bonacc1/process-compose/src/cmd.runTui in goroutine 1
	/home/eugene/projects/go/process-compose/src/cmd/project_runner.go:78 +0x68
  • Included the relevant configuration snippet

This is my process-compose.yaml:

version: "0.5"

processes:
  time:
    working_dir: .
    command: "while :; do sleep 1; date; done"
  • Included the relevant process-compose log (log location: process-compose info)

The process-compose log is basically empty:

cat /var/folders/v3/gmv1ttkd38j02h_xdv7f4nd80000gn/T/process-compose-smeijer.log
24-05-17 09:47:06.454 INF Process Compose v1.0.1

Version of process-compose

Process Compose
Version:        v1.0.1
Commit:         caa1a4d
Date (UTC):     2024-03-24T00:24:47Z
License:        Apache-2.0
Discord:        https://discord.gg/S4xgmRSHdC

Written by Eugene Berger

OS environment:

MacOS 14.3.1

Steps or code to reproduce the issue:

  • process-compose up
  • click the border that shows the selected process name

Expected result:

don't crash

Actual result:

crash

@shivaraj-bh
Copy link
Contributor

Able to reproduce on x86_64-linux as well

shivaraj-bh added a commit to shivaraj-bh/process-compose that referenced this issue May 17, 2024
… v0.0.0-20240505185119-ed116790de0f

This version includes rivo/tview#959, which resolves F1bonacc1#186
@F1bonacc1 F1bonacc1 added the bug Something isn't working label May 17, 2024
@F1bonacc1
Copy link
Owner

Fixed in v1.6.1

P.S.
@smeijer thank you for the excellent Process Compose article: https://meijer.ws/articles/improve-your-dev-stack-with-process-compose ❤️

@smeijer
Copy link
Author

smeijer commented May 17, 2024

Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants