directory
Terminal cursor disappearance causes echo and hide cursor methods boot automatic echo cursor summary
The reason the terminal cursor disappears
When I was using the Ubuntu subsystem terminal, the cursor would often disappear after a single action. Now I suddenly found the reason for the switch between Chinese and English input. When I just entered the terminal, because it was Chinese input, I did not pay attention to typing a few words, so I switched to English with shift
casually, and then the cursor disappeared. If you want to retrieve the cursor, press shift
to switch the input method to see the cursor.
Echo and hide cursor methods
# Hide the cursor
echo -e "\033[?25l"
# Show cursor
echo -e "\033[?25h"
Power on auto echo cursor
I mainly encountered the following problems in the process of using the Ubuntu subsystem. Although the above command can be normally displayed back to the cursor each time, once the terminal is closed, the cursor is not opened again, so I need to continue typing the above command, but it is very troublesome to go one after another, so I have the following solution ideas.
write shell script, named cursor_show.sh
:
#!/bin/bash
echo -e "\033[?25h"
Set automatic startup execution, /etc/init.d/
directory is stored in the program of automatic startup execution:
>$ chmod +x cursor_show.sh
>$ sudo mv cursor_show.sh /etc/init.d/cursor_show.sh
conclusion
This is my personal solution to the ubuntu subsystem, but if you have the same problem on other Linux systems, try it.
Read More:
- Setting up automatic networking alias for Mac Terminal
- How to Fix xterm Xt error: Can’t open display: xterm: DISPLAY is not set
- [Solved] Ubuntu Terminal Error: subprocess installed post-installation script returned error exit status 1
- hb set Error: OHOS ERROR] Invalid vendor path: /home/openharmony/vendor (openharmony Compile ubuntu20.04 official document)
- How to set fixed IP address for Raspberry Pie
- [Solved] TclError: couldn‘t connect to display “localhost:11.0“
- Mac opens Terminal and reports an error -bash:: command not found
- How to open X Display on the server side (locally operable remote interface)
- [Linux] [Ubuntu] Error opening terminal: xterm-256color
- How to Solve Ubuntu “Failed to fetch” Error
- [Solved] NameError: name ‘reload’ is not defined on ROS melody terminal
- [Solved] Linux SSH Login Terminal Error: shell request failed on channel 0
- The semget function error: errno is set to 28 [How to Solve]
- Ubuntu Server: How to Install Chrome
- Ubuntu Run Error: not syncing : VFS: Unable to mount root
- [Solved] Ubuntu 20.04.3 Fail to Start sshd Error: Failed to start OpenBSD Secure Shell server
- Ubuntu Startup Error: warning failed to connect to lvmetad,falling back to device scanning
- How to Uncompress 7z files on Ubuntu, Debian, Fedora
- [Solved] Ubuntu 20.04 Error: curl: (23) Failure writing output to destination
- How to Solve Xmind Install Error in Ubuntu System