Skip to content

Conversation

@kujtimiihoxha
Copy link
Contributor

@kujtimiihoxha kujtimiihoxha commented Dec 11, 2025

You can now use lazygit inside of crush.

image
lazygit.mp4

OpenReasoningDialogMsg struct{}
OpenExternalEditorMsg struct{}
ToggleYoloModeMsg struct{}
OpenLazygitMsg struct{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of making this hardcoded, uses should define their commands in the config and Crush should load the list of defined termdialog commands

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially we want to only setup some known integrations and we will add the config later.


// Add lazygit command if lazygit is installed.
sh := shell.NewShell(nil)
if _, _, err := sh.Exec(c.ctx, "which lazygit"); err == nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is bad. Exec should be able to look for the binary in $PATH automatically. Otherwise, you should be using exec.LookPath

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to use the shell we use for the bash scripts but I can change this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, let's make this configurable in the json instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially we want to only setup some known integrations and we will add the config later.


ctx context.Context
pty xpty.Pty
vterm *vt.Emulator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep in mind that vt is still missing some important VT features that might affect the output for some commands

}
return d, d.term.RefreshCmd()

case tea.KeyPressMsg:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The vt library might not handle certain Kitty enhanced keyboard keys because it doesn't implement that yet.

return d, nil
}

func (d *Dialog) handleResize(msg tea.WindowSizeMsg) (util.Model, tea.Cmd) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might break when the VT resize ends up with the cursor outside the screen. VT doesn't handle these cases nor wrapping the cursor on resize yet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not already clamping the cursor ? https://github.com/charmbracelet/x/blob/main/vt/emulator.go#L217

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should flow the cursor instead of clamping it. For example, when a screen gets narrow and increase in height where the cursor can no longer fits the width of the screen, it should flow to the next lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh I think we can def improve on this, but its good enough for an initial release.

@kujtimiihoxha kujtimiihoxha marked this pull request as ready for review December 16, 2025 09:01
@kujtimiihoxha kujtimiihoxha requested a review from a team as a code owner December 16, 2025 09:01
@kujtimiihoxha kujtimiihoxha requested review from andreynering and meowgorithm and removed request for a team December 16, 2025 09:01
@andreynering
Copy link
Member

This will need to be re-implemented for the new UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants