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

add syntax highlighting via themeing #377

Closed
wants to merge 3 commits into from

Conversation

jaycenhorton
Copy link
Contributor

Related to #333, this approach enables syntax highlighting, including for streaming chats

sgpt-theme

@TheR1D
Copy link
Owner

TheR1D commented Dec 6, 2023

Thank you for the PR @jaycenhorton, looks good! The only thing I don't like about rich markdown render is vertical overflow, when the output text is larger then terminal height, it renders elipsis at last line "...", until we will get full response from API. This is especially noticeable when you have small terminal window (not full screen). For regular user it might be confusing, since it looks like sgpt "hangs".

But this might be usefull for many sgpt users. Can we make it as optional feature? Using .sgptrc we could define something like RENDER_MARKDOWN=true (false by default).

@TheR1D TheR1D added the enhancement New feature or request label Dec 6, 2023
@jeanlucthumm
Copy link
Contributor

Regarding the vertical overflow, in the demo it seems like the terminal just scrolls when it hits the bottom. How is that achieved?

@TheR1D
Copy link
Owner

TheR1D commented Dec 12, 2023

Regarding the vertical overflow, in the demo it seems like the terminal just scrolls when it hits the bottom. How is that achieved?

As I described in my previous comment, when having a small terminal window (not full screen), and requesting some long text from LLM (which can't fit in current terminal window height), we will have vertical overflow.

Another thing which I was thinking about it that, by default ShellGPT needs plain text in order to exectue shell comamnds or create valid source code files. So this feature probably will require some tweaks in the default role, which will explicitly require markdown as output from LLM.

@TheR1D
Copy link
Owner

TheR1D commented Dec 19, 2023

Implemented in #400 with few role changes. Included @jaycenhorton as Co-Author of the commit, thank you for your interest and effort.

@TheR1D TheR1D closed this Dec 19, 2023
@jaycenhorton jaycenhorton deleted the jaycenhorton-theme branch January 2, 2024 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants