Linux分屏终端terminator的安装、简单字体颜色配置以及如何恢复默认终端

1安装

ctrl+alt+t 打开终端

运行命令

sudo apt-get install terminator
2常用命令
Ctrl+Shift+O
    Split terminals Horizontally.(上下开新窗口)
Ctrl+Shift+E
    Split terminals Vertically.(垂直开新窗口)
Ctrl+Shift+Right
    Move parent dragbar Right.(放大当前窗口 向右)
Ctrl+Shift+Left
    Move parent dragbar Left.
Ctrl+Shift+Up
    Move parent dragbar Up.
Ctrl+Shift+Down
    Move parent dragbar Down.
Ctrl+Shift+W
    Close the current terminal.
Alt+Up
    Move to the terminal above the current one.(切换当前窗口)
Alt+Down
    Move to the terminal below the current one.
Alt+Left
    Move to the terminal left of the current one.
Alt+Right
    Move to the terminal right of the current one.
Ctrl+Shift+S
    Hide/Show Scrollbar.(隐藏滚动条)
Ctrl+Shift+F
    Search within terminal scrollback
Ctrl+Shift+N or Ctrl+Tab
    Move to next terminal within the same tab, use Ctrl+PageDown to move to the next tab. If cycle_term_tab is False, cycle within the same tab will be disabled
Ctrl+Shift+P or Ctrl+Shift+Tab
    Move to previous terminal within the same tab, use Ctrl+PageUp to move to the previous tab. If cycle_term_tab is False, cycle within the same tab will be disabled
Ctrl+Shift+C
    Copy selected text to clipboard
Ctrl+Shift+V
    Paste clipboard text
Ctrl+Shift+Q
    Quits Terminator
Ctrl+Shift+X (最大化当前窗口)
    Toggle between showing all terminals and only showing the current one (maximise).
Ctrl+Shift+Z
    Toggle between showing all terminals and only showing a scaled version of the current one (zoom).
Ctrl+Shift+T
    Open new tab
Ctrl+Shift+Alt+T
    Open new tab at root level, if using extreme_tabs.
Ctrl+PageDown
    Move to next Tab
Ctrl+PageUp
    Move to previous Tab
Ctrl+Shift+PageDown
    Swap tab position with next Tab
Ctrl+Shift+PageUp
    Swap tab position with previous Tab
Ctrl+Shift+F
    Open buffer search bar to find substrings in the scrollback buffer. Hit Escape to cancel.
Ctrl+Plus (+)
    Increase font size. Note: this may require you to press shift, depending on your keyboard
Ctrl+Minus (-)
    Decrease font size. Note: this may require you to press shift, depending on your keyboard
Ctrl+Zero (0)
    Restore font size to original setting.
F11
    Toggle fullscreen(放大当前窗口)
Ctrl+Shift+R
    Reset terminal state
Ctrl+Shift+G
    Reset terminal state and clear window

3.简单配置

  原本的终端界面很丑,命令行全为白色,命令与其他内容难以区分,不易查找,还有可能出现文字重叠交错等问题,所以从网上学了一些简单的配置方法。

打开终端,空白位置鼠标右键点击,选择preferences进行简单设置。如下图,Colors  里,Built-in schemes 处可以设置背景颜色和字体颜色。General 里修改字体为FreeMono即可解决字体重叠问题。其他的一些设置可以自己根据个人需求修改。


效果


4.PS1修改命令行各字体颜色

   经过上述配置后,命令行依旧全是同一种颜色,很难从运行成果中找到自己输入的命令行。下面可参考https://www.cnblogs.com/Q--T/p/5394993.html 里的内容进行配置。

在终端输入:

echo $PS1   

得到当前的PS1值

yy@yy-ThinkPad-T470p:~$  echo $PS1
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$
PS1的常用参数以及含义:

  \d :代表日期,格式为weekday month date,例如:"Mon Aug 1"

  \H :完整的主机名称

  \h :仅取主机名中的第一个名字

  \t :显示时间为24小时格式,如:HH:MM:SS

  \T :显示时间为12小时格式

  \A :显示时间为24小时格式:HH:MM

  \u :当前用户的账号名称

  \v :BASH的版本信息

  \w :完整的工作目录名称

  \W :利用basename取得工作目录名称,只显示最后一个目录名

  \# :下达的第几个命令

  \$ :提示字符,如果是root用户,提示符为 # ,普通用户则为 $

在PS1中设置字符序列颜色的格式为:[\e[F;Bm]。其中“F”为字体颜色,编号30~37;“B”为背景色,编号40~47。

          颜色对照表:

    F    B

    30  40 黑色

    31  41 红色

    32  42 绿色

    33  43 黄色

    34  44 蓝色

    35  45 紫红色

    36  46 青蓝色

    37  47 白色

我的设置如下:
PS1="\[\e[30;42m\][\[\e[35;42m\]\u\[\e[30;42m\]@\h \[\e[33;42m\]\w\[\e[0m\]]\\$ "

打开 .bashrc文件(vim 或者 gedit 或其他编译器,都可以)

找到文件里如下图所示几行



xterm*|rxvt*)

    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;

*)

这几行里原本的PS1设置注释掉,插入

PS1="\[\e[30;42m\][\[\e[35;42m\]\u\[\e[30;42m\]@\h \[\e[33;42m\]\w\[\e[0m\]]\\$ "

保存关闭,在终端输入

source .bashrc 

生效就可以了。

这里配置比较复杂,我直接按照上面连接里博主的提示改的。

效果图:


5.更改 Ubuntu 默认终端工具

在 Ubuntu 系统中默认使用的终端工具是 gnome-terminal,而当我们安装完 Terminator 之后,Ubuntu 系统中默认采用的终端工具就变成了 Terminator,可以借助dconf-tools 工具来进行重新设置。

 安装dconf-tools

sudo apt-get install dconf-tools
安装成功后,终端中输入命令 “dconf-editor” 来打开这个工具,然后从左边的的菜单栏中按照下面的步骤依次进入指定的菜单项:
org > gnome > desktop > applications > terminal
此时,我们可以看到使用 Terminator 作为默认终端工具的配置为:
exec  x-terminal-emulator

exec-arg -e


如果想使用 gnome-terminal 为默认终端工具的话,就将上面的配置更改为:
exec  gnome-terminal

exec-arg -x


保存退出之后,使用快捷键 “Ctrl + Alt + T” 启动一个终端时,这时启动起来的就是 gnome-terminal 工具了!
  • 1
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Linux系统终端模拟器是一种软件应用程序,用于在Linux操作系统中模拟和提供命令行界面。它允许用户通过输入命令来与操作系统进行交互,并执行各种任务和操作。 终端模拟器通常提供以下功能: 1. 命令行界面:终端模拟器提供一个文本界面,用户可以在其中输入命令并查看命令的输出结果。 2. 多标签支持:终端模拟器通常支持多个标签页,用户可以在不同的标签页中同时执行不同的命令和任务。 3. 多窗口支持:一些终端模拟器还支持多个独立的窗口,用户可以在不同的窗口中同时进行不同的操作。 4. 自定义配置:用户可以根据自己的需求对终端模拟器进行配置,如修改字体颜色、快捷键等。 5. 历史记录:终端模拟器会保存用户输入的命令历史记录,方便用户查找和重复执行之前的命令。 6. 快速复制粘贴:终端模拟器通常支持快速复制和粘贴文本内容,方便用户在命令行界面中进行操作。 一些常见的Linux系统终端模拟器包括: 1. GNOME Terminal:GNOME桌面环境下的默认终端模拟器,提供了丰富的功能和配置选项。 2. Konsole:KDE桌面环境下的终端模拟器,具有类似于GNOME Terminal的功能和界面。 3. Xterm:一个简单而轻量级的终端模拟器,适用于各种窗口管理器和桌面环境。 4. Terminator:一个功能强大的终端模拟器,支持分割窗口和多标签页等高级功能。 5. Tilix:一个基于GTK+的终端模拟器,提供了可定制的外观和布局选项。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值