ansi_escape/doc/delete.md

38 lines
1.2 KiB
Markdown

Character deletion
==================
Erase character
---------------
```python
ansi_escape.erase_character(n)
```
Will erase n amount of characters from the cursor to the right of the cursor.
amount defaults to 1.
<!---Example:
0|1|2|3|4|5|6|7|8|9|10
:---|:---|:---|:---|:---|:---|:---|:---|:---|:---|:--
h|e|l|l|o|{cursor}|w|o|r|l|d
Here the cursor is on cell 5, if you where to run--->
Delete character
----------------
```python
ansi_escape.delete_character(n)
```
Works just like erase_character(), but after deleting the characters it wil shift any remaining characters to the left of the cursor by n amount.
If n is omitted it defaults to 1.
Erase in display
----------------
```python
ansi_escape.erase_in_display(n)
#or
ansi_escape.ed(n)
```
Will erase in the display from the cursor.
n is the direction from the cursor to erase in and can be : forward, backward, or both. n can also be "history" which works like "both", but will also include the buffered history of the terminal. I do not reccomend using history since it is not widley supported.
Erase in line
-------------
```python
ansi_escape.erase_in_line(n)
#or
ansi_escape.el(n)
```
Like erase in display, but limited to one line. The n variable works the same way, minus the history option.