Giter Site home page Giter Site logo

Comments (8)

flagarde avatar flagarde commented on September 24, 2024 1

@MCWertGaming Auto redrawing on resize windows can be integrated quite easily I think I made some PR already included to prepare the work. I agree some C++>11 are awesome. Maybe they could be integrated here with detection and option

from cpp-terminal.

MCWertGaming avatar MCWertGaming commented on September 24, 2024

Hey,
the enable_terminal was used to make it possible to use the terminal in raw mode without having to worry about input. Originally the input function @certik created had a fall-back implemented to make it possible to either enable the terminal processing and then read the input in real-time, or to disable it and read from the stdin as "pseudo input". Certik implemented it to test the multi-line prompt. I though about using it for things like:

A text editor that allows you to open a file and also act as cat-like too to read a file or output through the stdin. I have then later created a function that makes it possible to read the full stdin and get it as a full string in one go, but I haven't finished it yet. I also haven't looked into the strange thing that happen when the terminal is disabled. I'm also not sure yet what the the right purpose of this library is.

I guess that it would make sense to make a smaller call between us and @certik to discuss what we would like to implement as feature set and then also make a full proposal of a V1 "API" design. Like that we are making a functional design of the headers which represents all features we have discussed. We can then look into whether we would like to make a V2 design after that. But I guess that it would be important for this project to finally have a version that is convenient and makes sense to the user.

What do you think about this idea? I would also like to look into into two additional projects, which would be benefiting from this one, like a unit testing / integration testing framework for terminal based applications.

from cpp-terminal.

flagarde avatar flagarde commented on September 24, 2024

@MCWertGaming Corect me if i'm wrong but the keyboard is sending to stdin by default. I understand it is nice to check if stdin is a tty or a file for example or if has been redirected but this can be check in any moment and it has not to be done in the constructor of terminal...

This is one of the change I think it would be nice to do to simplify the terminal class. Open by ourself the terminal and FILE* to console in windows and linux and put them in rawmode. and then if stdout/stdin has not been redirected to switch the stdin and stdout to this FILE* handles.

I had some problem in windows because is application mode GUI, windows doesn't create console by himselft so we have to do it by ourselft. If we do it in any case it would simplify and allow user to use stdin_console or stdout_console to be sure they are talking to a tty event if stdout our stdin has been redirected.

from cpp-terminal.

flagarde avatar flagarde commented on September 24, 2024

@MCWertGaming Yes, I would aggree to have so discussion if you want. But I can't promess to work on the library (I'm doing it on free time and because this library is very useful and could be a nice replacement from other a bit more difficult to configure etc)

from cpp-terminal.

MCWertGaming avatar MCWertGaming commented on September 24, 2024

Hey, It's alright. I'm working on this in my free time as well and got busy for the last months with work etc. I'll try to get this into a V1 state in the next weeks so people can finally use this as a nice and uncomplicated curses alternative.

My requirements for this library have shifted a bit though in the last months though as well. Mostly because I'm doing responsive applications like games and animated UIs in the terminal, which is library is not that nice in. It also bothers me that I can't use C++20 features here like std::jthread to create a real time renderer etc. I guess that I'll look into bringing this to a well defined API and then make a derived library on top of that implements the real-time rendering and other things that come in handy. We can then look into moving stuff back into here or how we'll implement things. But I would like to keep this as compatible as possible in terms of compilers, systems and terminals.

I really appreciate your work on this library though @flagarde. You brought this a lot forward already. And I look forward to your next contributions!
Thank you.

from cpp-terminal.

flagarde avatar flagarde commented on September 24, 2024

@MCWertGaming You can use c++20 of course but c++20 it's still not very standard in everyday life :( C++11 seems for now the best we can be assured on. Maybe you could develop c++ stuf that could be compiled in option.

Now i'm focusing on cleaning a bit more the code, allowing to attach the console on windows even on a GUI app, and finish the color setting for at least default terminal on the main OS + ansicon detection for old windows.

from cpp-terminal.

flagarde avatar flagarde commented on September 24, 2024

@MCWertGaming The main feature I would like to be completed and I can contribute is the mouse handling and even more important the resizing capability (redrawing on terminal size)

from cpp-terminal.

MCWertGaming avatar MCWertGaming commented on September 24, 2024

@flagarde Yeah, C++11 is the right choice for this kind of library. I Just like to use newer C++ versions for my personal projects like my games etc. Mouse handling would be awesome, I'll implement the resizing in the separate terminal engine probably since it might be nice to have some kind of UI scaling / switching to another UI instead on my applications.

I'm currently creating an API design that should cover all features that are currently planed for V1.0.0 and will announce it when i'm done with it. I'd like you and a few others to review it so it's suitable for all use cases.

from cpp-terminal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.