Ubuntu远程桌面终端异常如何恢复默认设置?及默认修改终端背景色方法
Hey John, let's work through your Ubuntu remote desktop problems and get things back on track. Here's how to resolve the terminal color/icon glitches and set a default terminal background color permanently:
Since the issue started after your initial remote connection, resetting the relevant system settings to their factory defaults is the most reliable fix (no manual color tweaking needed):
Reset Terminal to Default Settings
Open a terminal (even if it's white-backgrounded) and run this command to wipe all custom terminal configurations:dconf reset -f /org/gnome/terminal/This will restore the terminal's original purple background, font settings, and other defaults immediately.
Reset Desktop Icon & Interface Settings
If your icons are still corrupted after resetting the terminal, reset the GNOME interface defaults to fix icon themes and other visual glitches:dconf reset -f /org/gnome/desktop/interface/You might need to log out and log back in for this change to take full effect.
Once your system is back to normal, you can set a custom default terminal background color using either the graphical interface or command line:
Method 1: Graphical Interface (Easy)
- Open the terminal, click the menu button (three lines) in the top-right corner.
- Select Preferences → Go to the Profiles tab (the default profile is usually named "Unnamed").
- Click the Colors tab, uncheck "Use system theme colors" if it's enabled.
- Click the color picker next to "Background color" and choose your preferred color.
- Finally, click Set as Default at the bottom of the Profiles tab to make this the default for all new terminal windows.
Method 2: Command Line (For Automation)
If you prefer using commands, run this to set a custom background color (replace #your-hex-color with your desired color code, e.g., #300a24 for the default purple):
# Get the default profile ID DEFAULT_PROFILE=$(gsettings get org.gnome.Terminal.Legacy.Profile default | tr -d "'") # Set the background color gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$DEFAULT_PROFILE/ background-color '#your-hex-color'
For example, to set a dark gray background, use '#2c2c2c'.
内容的提问来源于stack exchange,提问作者John

