本人比较喜欢Ubuntu这个Linux的发行版,主要是安装程序插件什么的都比较方便,推荐新手使用,可以免去很多麻烦的配置,将注意力放在编程的学习上,当然如果是想专门学Linux的,还是推荐在Centos或者红帽上捣鼓捣鼓,慢慢地对Linux就熟悉了。

每次新安装Ubuntu的中文版,一开是Ubuntu的终端Xterm显示的中文都会有很多乱码,甚至有些中文汉字显示不出来,使用起来很不方便,像这样子:

在网上找了很多资料,发现可以通过重新配置Xterm来解决中文乱码问题已经优化Xterm的显示效果。

打开/etc/X11/app-defaults/XTerm,像这样

在最下面添加如下代码:

Xft.dpi:96   
xpdf.title: PDF   
XTerm*faceSize: 10   
XTerm*faceSize1: 10   
XTerm*faceSize2: 10   
XTerm*faceSize3: 10   
XTerm*faceSize4: 10   
XTerm*faceSize5: 10   
XTerm*faceSize6: 10   
XTerm*jumpScroll: true   
 
xterm.termName: xterm-256color  
xterm.geometry: 80x36  
xterm*scrollBar: false  
xterm*rightScrollBar: true  
xterm*loginshell: true  
xterm*cursorBlink: true  
xterm*background:   black  
xterm*foreground:   gray  
xterm.borderLess: true  
xterm.cursorBlink: true  
xterm*colorUL: yellow  
xterm*colorBD: white  
   
!fix alt key input  
xterm*eightBitInput: false  
xterm*altSendsEscape: true

!mouse selecting to copy, ctrl-v to paste  
!Ctrl p to print screen content to file  
XTerm*VT100.Translations: #override \  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ctrl <KeyPress> V: insert-selection(CLIPBOARD,PRIMARY,CUT_BUFFER0) \n\ &nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BtnUp>: select-end(CLIPBOARD,PRIMARY,CUT_BUFFER0) \n\ &nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ctrl <KeyPress> P: print() \n &nbsp;
&nbsp;
!font and locale &nbsp;
!xterm*locale: true &nbsp;
!xterm.utf8:&nbsp;&nbsp;&nbsp;&nbsp; true &nbsp;
!xterm*utf8Title: true
xterm*fontMenu*fontdefault*Label: Default &nbsp;
xterm*faceName:DejaVu Sans Mono:antialias=True:pixelsize=16 &nbsp;
!xterm*faceName: monofur:antialias=True:pixelsize=20 &nbsp;
xter*boldFont: Bitstream Vera Sans Mono:style=Bold:pixelsize=15 &nbsp;
xterm*faceNameDoublesize:WenQuanYi Zen Hei:antialias=True:pixelsize=15 &nbsp;
xterm*xftAntialias: true &nbsp;
xterm.cjkWidth:true &nbsp;
XTerm*inputMethod: ibus
XTerm*preeditType: Root &nbsp;

PS:如果不是root用户直接通过gedit打开文件的话,普通用户是没有权限修改这个文件的,解决的方法就是在终端Xterm下输入命令:sudo gedit /etc/X11/app-defaults/XTerm,这样打开的XTerm配置文件经过修改当前用户是有权保存并生效的。重启Xterm,效果是不是美观很多呢。

Ubuntu下XTerm乱码问题的解决及XTerm的简单配置的更多相关文章

  1. navicat在ubuntu下中文乱码的真正解决方法ZT

    乱码解决方法(自己解决我自己这种情况之后打猜测): 打开start_navicat文件,会看到 export LANG="en_US.UTF-8" 将这句话改为 export LA ...

  2. Ubuntu下搜狗输入法乱码(二)

    本文适用于Ubuntu 16.04,造冰箱的大熊猫@cnblogs 2018/10/25 搜狗输入法时不时出现候选字乱码的问题.参照网上所说的修改Fcitx配置中的简体中文和繁体中文转换配置的方法,无 ...

  3. ubuntu下su: Authentication failure的解决办法(su和su - root的区别)

    参考:ubuntu下su: Authentication failure的解决办法(su和su - root的区别)

  4. ubuntu下中文乱码解决方案(全)

    转自 http://www.cnblogs.com/end/archive/2011/04/19/2021507.html   1.ibus输入法 Ubuntu 系统安装后已经自带了ibus输入法,在 ...

  5. Ubuntu 下 su:authentication failure的解决办法

    Ubuntu下使用 su 切换到超级用户时候遇到下面的问题 su: Authentication failure 解决办法: $ sudo passwd root Enter new UNIX pas ...

  6. ubuntu下安装Firefox中国版解决Ubuntu与Windows下Firefox账号同步问题(已解决)

    1. 下载最新版本火狐Linux版 下载地址:http://firefox.com.cn/download/ 选择火狐Linux64-bit版,下载后文件为:Firefox-latest-x86_64 ...

  7. [问题记录]Ubuntu下chmsee安装失败的解决

    日期:2016年2月26日 一直在找Ubuntu下查看chm的工具但是普遍不理想,发现在deepin中的chmsee相对比较好,但是直接执行网上的sudo apt-get install chmsee ...

  8. 在Windows环境下使用短信猫收发短信的简单配置:

    Windows简单配置: 1.插入usb接口,打开电脑的设备管理器,装驱动后,查看端口下设备的com(串口)是多少,接下来就是配置短信猫的必须参数: 如果短信猫是COM(串口)口的,一般端口是COM1 ...

  9. 解决windows下文件拷贝到ubuntu下文件名乱码的问题

    sudo apt-get install convmv     解压zip文件:    convmv -f gbk -t utf8 -r --notest *

随机推荐

  1. java 获取当前进程id 线程id

    java  获取当前进程id  线程id RuntimeMXBean (Java Platform SE 8 ) https://docs.oracle.com/javase/8/docs/api/j ...

  2. collision weaknesses

    15.1. hashlib — Secure hashes and message digests — Python 3.5.6 documentation https://docs.python.o ...

  3. stark - 注册表、生成url

    一.配置 stark组件开发,仿django自带得admin组件. 1. startapp stark 2. settings: 'stark.apps.StarkConfig' 3. 启动就执行 f ...

  4. 把大象装进冰箱的N种方法

    作者:折剑头链接:https://www.zhihu.com/question/49214119/answer/115728034来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注 ...

  5. 滚动侦测scrollspy

    <!doctype html><html> <head><meta charset="utf-8"><meta http-eq ...

  6. Windows版本搭建安装React Native环境配置

    1 安装Chocolatey 打开cmd黑窗口 @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-obje ...

  7. HDU1573:X问题(解一元线性同余方程组)

    题目:http://acm.hdu.edu.cn/showproblem.php?pid=1573 题目解析;HDU就是坑,就是因为n,m定义成了__int64就WAY,改成int就A了,无语. 这题 ...

  8. 2.7 The Object Model -- Bindings, Observers, Computed Properties:What do I use when?

    有时候新用户在使用计算属性.绑定和监视者时感到困惑.下面是一些指导方针: 1. 使用computed properties来合成其他属性,以构建新的属性.computed properties不应该包 ...

  9. 7.2 Models -- Defining Models

    一.概述 1. 模型是一个类,它定义了你呈现给用户的数据的属性和行为.用户希望如果他们离开你的应用程序,并返回后(或如果他们刷新页面)看到的任何东西应该被一个model代表. 2. 确保在ember. ...

  10. 77. Combinations(回溯)

    Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. Example: I ...