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 rudimentary command-line history (up/down arrow) #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cculianu
Copy link
Contributor

This commit adds very rudimentary command-line history support. Use the
up/down arrow to navigate the history.

This commit also adds an additional command, "history" to view the
history.

This commit adds very rudimentary command-line history support. Use the
up/down arrow to navigate the history.

This commit also adds an additional command, "history" to view the
history.
@cculianu cculianu force-pushed the add_command_line_history branch from 4c4a63f to 11a02ab Compare July 12, 2021 22:24
@jantari
Copy link

jantari commented Jul 16, 2021

Isn't command-history a feature implemented by the shell and not the terminal?

@cmuratori
Copy link
Owner

cmuratori commented Jul 16, 2021

It is, but I believe the intent here was to avoid having to retype commands (when testing stuff in refterm)?

- Casey

@cculianu
Copy link
Contributor Author

cculianu commented Jul 16, 2021

Yeah, you're both right. :) Ideally we'd have this refterm talking to a shell in the canonical way so that the shell itself does all this business (I am not even sure how to do that on Windows -- I'm more of a Unix guy as of late and forgot my windows incantations -- I'd need to brush up on them -- on Linux for instance you'd allocate a pty and give that to a persistent shell process and the shell would talk to the rendering windowing app via that).

This is just a quick feature to make it easier to use refterm right now as it stands -- until maybe refterm can be reconfigured/recoded to actually just use cmd.exe or bash.exe or whatever your favorite shell is as the real driver... and refterm maybe some day can just do rendering only.

@cmuratori
Copy link
Owner

It would be fairly straightforward to reconfigure refterm that way, but unfortunately it would mean that you could no longer use it for performance testing, because you'd always be going through the slowest possible path (cmd.exe<-conhost<-test.exe). So I don't think it's feasible to do this, although it would be fine to make a #define that did this for people who want that (or a command you run, like "shell", that launches cmd.exe permanently inside refterm, etc.)

- Casey

@cculianu
Copy link
Contributor Author

cculianu commented Jul 16, 2021

Sure. Up to you. I personally don't have a strong opinion either way. I think for what you wanted to accomplish -- which was demonstrate and benchmark the potential speed one can get with rendering itself -- this is fine as-is.

As for this particular PR: I just wanted to make what you have now here be slightly more ergonomic, is all. So that up/down arrow works and lets you scroll back through commands, etc.

My personal agenda here is thus: I actually have always wanted to write a better term program (in particular for windows -- I too share your frustration at the seemingly abysmal performance of current popular options). When I came across your videos that showed it's possible to have reasonably correct rendering at blazing speeds, I was inspired. So -- some day I plan on maybe taking some of the very fast (and correct!) rendering code you have developed here and folding it into a more full-featured term program (time permitting -- in the future). Hence my interest in your project....

@n00bmind
Copy link

@cculianu may I suggest you have a look at the handterm project at https://github.com/jfhs/handterm? jfhs has already started some great work on completely removing the dependency on the conhost subsystem on Windows, and I'd like to help him integrate refterm's renderer so we have a great foundation for building a no-bullshit terminal for the community.

@cmuratori
Copy link
Owner

Yes, putting resources behind handterm would be a very good idea. jfhs and I have talked separately about this and I do think that project is the current best bet for getting a full terminal for Windows that is performant.

- Casey

@cculianu
Copy link
Contributor Author

@n00bmind @cmuratori thanks for the tip. When I get some free time I’ll check out that project. Sounds like a good plan to me.

@Kein
Copy link

Kein commented May 12, 2022

Seems like handterm died out as well, yet WT thrives. Which kinda indicate it isnt about performance but resources put behind the thing that make it feasible and relevant.

@bagucode
Copy link

Seems like handterm died out as well, yet WT thrives. Which kinda indicate it isnt about performance but resources put behind the thing that make it feasible and relevant.

A fast terminal would be preferred by many if it existed! It's just a lot of work to actually make something polished and nice to use and to keep maintaining it. WT is made by people paid by MS to do it so of course it will keep living, that has nothing to do with usability or technical merit. They are also very good at telling people about it. I don't think many people outside of the Handmade community even knows about refterm or any spinoffs. Marketing matters way more than quality if you want someone to actually use your thing.
It sounds to me like you think these things are somehow connected but they are not. Quality is a separate thing from something existing and being used. But if all other things are equal, quality wins.

@nikbackm
Copy link

Wasn't WT planning to include some of the performance enhancements from refterm anyway? I think I saw an issue made for that once. It has not landed yet, still as slow, but it will likely take some time to adjust their architecture to fit it in.

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.

7 participants