在Ubuntu22.04中,Backspace键产生的代码序列错误而导致的无法删除字符的问题.

发布于:2022-10-28 ⋅ 阅读:(590) ⋅ 点赞:(0)

昨天, 俺好不容易安装好51单片机在linux下的开发环境,sdcc, stcgal,ch34x.ko.

正把商家给的代码资料改改,在ubuntu终端跑跑, 然后到蜂鸣器模块就悲催了,在连续烧录

并更改了几次代码后,蜂鸣器就放飞自我了, 滴答滴答不停了, 烧录新的程序也不行, 急得

我放出了Ctrl+C,手忙脚乱之下甚至按到了Ctrl+A.重新连接USB口,方可烧录新程序.

但是事情不会总是很完美......终端坏了.Backspace按键不能删除终端的字符, 但在别的程序

比如Firefox中,又是正常的.上网上查询,有挺多文章都说是, 误删了ncurses-base导致的, 需要

重新安装, 但是终端反馈给我的却是

user@user:~$ ​​sudo apt install ncurses-base
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成                 
ncurses-base 已经是最新版 (6.3-2)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。

很明显,这不能解决我的问题.

试过更换shell(fail),重装终端(gnome-terminal)(fail),安装其他终端模拟Guake,terminator,konsole

(虽然Backspace可以正常使用, 但问题本质上没有解决). 终于,在海海的帖子中它出现了,https://www.cnblogs.com/ZenCollection/p/10374096.html

下面是dconf-editor的介绍


NAME
dconf-editor - Graphical editor for gsettings and dconf
SYNOPSIS

dconf-editor [OPTIONS...]
dconf-editor [OPTIONS...] [PATH]
dconf-editor [OPTIONS...] [FIXED_SCHEMA | RELOCATABLE_SCHEMA:PATH] [KEY]
DESCRIPTION

The dconf-editor program provides a graphical interface for editing settings that
 are stored by other applications using the gsettings functions of the glib 
library, or in the dconf database. The gsettings(1) and dconf(1) utilities provides 
similar functionality on the commandline.

OPTIONS

-h, --help
    Prints the command-line options and exits.
-v, --version
    Prints the release version and exits.
--list-relocatable-schemas
    Prints the list of relocatable schemas and exits.
--I-understand-that-changing-options-can-break-applications
    Launches application without showing initial warning.

 安装

sudo apt install dconf-editor

在dconf-editor中,输入backspace

 将Backspace键产生的代码序列当前值,设置为'ascii-delete' 解决问题.

 所以我还是不明白我怎么把Gnome-terminal的profile修改成'ascii-sequence'的.

又是解决问题(表面上)的一天,要想不出问题还得学linux系统的运行机制.