[Terminal] 终端显示格式错乱 V20.7.1 Resolved
Tofloor
poster avatar
Master Yi
deepin
2023-04-17 23:32
Author

问题/建议描述

image.png

终端显示格式错乱,向上检索历史命令无法正常显示,退格(Back)键同样也无法使用,stty erase = ^?

image.png

cat .bashrc | grep PS1
PS1="[[\e[34;48m]\u[\e[0m] ($(date +%H:%M)) [\e[32;22m]\w[\e[0m]]\$ "
PS1="\u@\h:\w\$ "

stty -a

speed 38400 baud; rows 29; columns 110; line = 0;
intr = ^C; quit = ^; erase = ^?; kill = ^U; eof = ^D; eol = ; eol2 = ; swtch = ;
start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon ixoff -iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc

问题如何重现

暂不知晓如何触发的。

使用同样的PS1变量,stty设置,只有系统的终端出现该问题,如果用QT的Xterm或者其它终端软件该问题没有出现。

问题重现频率

必现

Reply Favorite View the author
All Replies
liwl
deepin
2023-04-17 23:49
#1

这是本地的shell还是远程的shell?

Reply View the author
jjcui8595
deepin
2023-04-18 00:02
#2

新建一个账户试试

Reply View the author
ArchieMeng
deepin
2023-04-18 00:12
#3

跑一下reset重置吧.

可能做了什么操作把TTY配置搞乱了吧.

Reply View the author
Master Yi
deepin
2023-04-18 00:16
#4

image.png

terminfo数据丢失了,可能是上一次关机异常,在initramfs模式下清理过一次xfs分区的日志,导致了部分数据的丢失。
临时设一下 export TERM="linux"能解决,看看能不能从其它地方打包一下这个目录的数据

Reply View the author
ArchieMeng
deepin
2023-04-18 00:52
#5
Master Yi

image.png

terminfo数据丢失了,可能是上一次关机异常,在initramfs模式下清理过一次xfs分区的日志,导致了部分数据的丢失。
临时设一下 export TERM="linux"能解决,看看能不能从其它地方打包一下这个目录的数据

不对呀,我把terminfo也清了,设置成你的PS1参数,但也没复现.

Reply View the author
Master Yi
deepin
2023-04-18 00:53
#6

系统上的文件路径和centos还是有点不太一样😂 ,不过从centos的rpm数据库里边检索相关文件,发现是来自ncurses-base包的,deepin系统下的包名也一样。sudo apt reinstall ncurses-base重新安装并重启终端就好了。

Reply View the author
Master Yi
deepin
2023-04-18 00:57
#7
ArchieMeng

不对呀,我把terminfo也清了,设置成你的PS1参数,但也没复现.

我参考的是centos上的路径,deepin下的路径应该是/lib/terminfo(我不太确定,没细查),重装这个之前,/lib/x目录下是空的

image.png

Reply View the author
Master Yi
deepin
2023-04-18 00:59
#8
ArchieMeng

不对呀,我把terminfo也清了,设置成你的PS1参数,但也没复现.

image.png

Reply View the author
ArchieMeng
deepin
2023-04-18 01:00
#9

没看懂.你是在centos上用的?deepin的话,我看这个包应该是自带的,卸载它还有警告的.

Reply View the author
ArchieMeng
deepin
2023-04-18 01:01
#10
Master Yi

image.png

了解.那就是缺 ncurses-base的问题.

Reply View the author
Master Yi
deepin
2023-04-18 01:02
#11
ArchieMeng

没看懂.你是在centos上用的?deepin的话,我看这个包应该是自带的,卸载它还有警告的.

deepin上的数据可能是上一次关机异常,清理过xfs磁盘的日志,丢失了部分内容。我参考了centos上的类似的配置文件,定位到可能是terminfo文件丢失,重装了ncurses-base这个包,问题确实得到了解决

Reply View the author
ArchieMeng
deepin
2023-04-18 01:06
#12

我搞懂你的情况了.不过,解决了就好.

Reply View the author
ljq790615
deepin
2023-04-18 06:23
#13

image.png

Reply View the author
xuqi
deepin testing team
2023-04-18 17:29
#14
  • v20上终端最新版本是5.9.40~
Reply View the author