I'm writing a program that needs to modify the terminal screen buffer without using printf or stdout. On win32 I did that by using CreateConsoleScreenBuffer() and SetConsoleActiveScreenBuffer() then writing to the console screen buffer using WriteConsoleOutputCharacter(). I want to do this on linux as well (kind of like how vim prints things out) but I can't find any way. It would also be great if there was a way to do this using the standard library!
How can I print characters to screen like vim on linux?
170 Views Asked by Phillip At
1
There are 1 best solutions below
Related Questions in C++
- How to immediately apply DISPLAYCONFIG_SCALING display scaling mode with SetDisplayConfig and DISPLAYCONFIG_PATH_TARGET_INFO
- Why can't I use templates members in its specialization?
- How to fix "Access violation executing location" when using GLFW and GLAD
- Dynamic array of structures in C++/ cannot fill a dynamic array of doubles in structure from dynamic array of structures
- How do I apply the interface concept with the base-class in design?
- File refuses to compile std::erase() even if using -std=g++23
- How can I do a successful map when the number of elements to be mapped is not consistent in Thrust C++
- Can std::bit_cast be applied to an empty object?
- Unexpected inter-thread happens-before relationships from relaxed memory ordering
- How i can move element of dynamic vector in argument of function push_back for dynamic vector
- Brick Breaker Ball Bounce
- Thread-safe lock-free min where both operands can change c++
- Watchdog Timer Reset on ESP32 using Webservers
- How to solve compiler error: no matching function for call to 'dmhFS::dmhFS()' in my case?
- Conda CMAKE CXX Compiler error while compiling Pytorch
Related Questions in TERMINAL
- How to fix npm errors without writing sudo in macOS?
- using whisper in the terminal gives an error
- Ubuntu terminal unable to take in input and read directories
- How do I get my terminal to work in VS Code? Exit Code:2, doesn't allow me to type anything
- Use `ffprobe` to display subtitle content like the `cat` command
- I am using the bash terminal in VS Code, I am new to coding, and the terminal displays very differently, how do I get them to match?
- Reading & Writing to the same file from terminal
- In VS Code, when sending Python lines to terminal, why do I have to re-send lines that set a variable to an edited value before the lines that use it?
- I tried installing Bagisto on a Pi, and I decided to uninstall it. Now, my PHPmyadmin doesn't work
- Create react app not working, file already exists with EEXIST error
- c++ python ctypes dependency issues
- Auto-activation of the conda environment in the terminal (ps, cmd, bash) in VS Code on Windows 11 does not work. How to solve this problem?
- Command Prompt/PowerShell Closing Automatically with Error -532462766/-1 in Visual Studio Code
- Output from sys.exit sometimes appears on terminal before output from print
- minikube not starting the service
Related Questions in ANSI-ESCAPE
- General text wrap program in C
- Prepend a marker string in front of each line of another program's output, while preserving aligned tab-formatted tables
- Is there a way to send colour commands within an <xsl:message> to the console (wt.exe) from Saxon XSLT?
- Stop make shell interpreting arrow up
- Why are my Bash variables getting set late, animate text function
- How to determine terminal cursor visibility?
- How do I use System.Console.ANSI to wrap a String in escape sequences for getting it colored in the terminal?
- How to address ANSI Escape Sequences in sed?
- How to display ANSI colors in VSCode debug console?
- why 8-bit CSI cannot work in Terminal.app of macOS?
- How do I handle ansi escape sequences from a file?
- updating code already written, I need help for triple loops ForEach-Object to varie 3 variables
- Can I Prevent Git from Using XTerm Escape Sequences?
- Use ansi escape sequences to create a border between input and output
- Capture Mouse Events in the Terminal using Ruby
Related Questions in TPUT
- Why are my Bash variables getting set late, animate text function
- dsh/pdsh tput: No value for $TERM and no -T specified
- tput ed doesn't work once terminal starts scrolling
- Inline Printing For Zsh Autosuggestions adding extra space when deleting
- How can I print characters to screen like vim on linux?
- Can I push/pop attributes with tput?
- Can I stop total line clearing when backspacing on a read in Bash?
- why does ''tput ed'' delete lines, instead of just clearing one line?
- How to reset tput text decoration and color
- Why \r required when using tput el1
- Parallel subshells doing work and report status
- Clear wrapped lines with curses
- How to delete everything after the cursor?
- $(shell tput sgr0) in Makefile cause "syntax error near unexpected token `('"
- Python3 + How to change the output color when using print command
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
OP says
you could use stderr (which usually points to the same terminal), e.g.,
to clear the screen while writing to stderr. Or you could use
tput, e.g.,