All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
2answers
55 views

Text from standard input not visible after program exits from a readline

I am facing an issue where the text from my stdin is not visible from on my terminal. My program does the following Sets a SIGALRM handler which exits a program when there is no input from the user ...
2
votes
1answer
292 views

How to print filled shapes in the terminal?

How to print a filled circle or shapes in the terminal like:
3
votes
3answers
3k views

Behaviour of the backspace on terminal

This is about the behaviour of the backspace (\b) character.  I have the following C program: int main() { printf("Hello\b\b"); sleep(5); printf("h\n"); return 0; } The output on my ...
1
vote
2answers
347 views

force output to input (buffer) like “\033[6n” in a script

I have tried using pipes and redirections to have (C program or scripts) output end up on the input buffer, the way printf "\033[6n" does, but no positive results. Does anyone know how this is ...
1
vote
2answers
673 views

How to allow backspaces in unbuffered/non-canonical mode?

I'm working on multiple C programs like a shell and a text editor that require to be run without the ECHO and ICANON flags. I disabled these using termios.h and managed to write my own gets function ...
-2
votes
2answers
150 views

Reverse Kanji letters in the console

For an application I am develloping right now, (a shogi software), for text mode, i need to make upside down the graphics of the pieces , because the opponent's pieces are reversed. However, Unicode ...
5
votes
2answers
99 views

Is it possible to allow a background process to continuously output to terminal?

Here's a use-case to clarify my question. Say I have a calendar program that is set to run in ~/.bashrc, and it ensures the streaming output overwrites the same block of lines. Is it possible to have ...
1
vote
1answer
296 views

Entering ascii chars as program input

If I write a very simple C terminal program that takes an input, how can I enter an ascii character as the input, like for instance the backspace character?
1
vote
1answer
458 views

How to read from another terminal?

I opened two terminals (/dev/pts/1 and /dev/pts/2) and started my application from /dev/pts/1. I want to read in real time from /dev/pts/2 but my code doesn't work: actually some of the symbols are ...
2
votes
2answers
155 views

What is bitwise.c~? [duplicate]

I am trying to made a program to experiment bitwise operators. The name of the program is bitwise.c Before compiling the program, I decided to look at the directory just in case I don't get the name ...
2
votes
3answers
1k views

Linux GCC compiler options

I have recently started using Linux as a tool for programing. In my book, I have seen that the GCC is used with 2 options: -g and -o. Now, I know that -o is to set a filename, but what is the purpose ...
0
votes
3answers
920 views

What to change to place text in the centre of the screen [closed]

The following program will clear the screen #include <stdio.h> int main() { fputs("\033[2J", stdout); return 0; } So, what should I modify/add in the above code to put a text string in ...