-
Delete Character
Hello,
Currently I am working on some simple shell programming utilities that mimic capabilities of editors. Most everything I want is working, and I have standard input set to non canonical mode. I am able to successfully trap the backspace and delete key, and after that I want to be able to delete a character from the screen. I am achieving this by printf("\b"), however on some terminals this only seems to perform a backspace, and leaves the previously printed character on the screen. I am able to get around this with printf("\b \b"), however I was wondering if there is a better way to do this?
-
I'm going to guess this is because terminals can be set to interpret the backspace key in different ways.
If by "shell programming utilities" you mean you are actually coding this stuff in bash, you are stuck. Otherwise, just use a library like ncurses.