【问题标题】:How do I prevent X11 from setting opost for tty7?如何防止 X11 为 tty7 设置 opost?
【发布时间】:2016-09-25 18:32:44
【问题描述】:

美好的一天:

我的带有 i915 显卡的 Ubuntu 16.04.1 机器对 tty2 有以下设置:

速度 38400 波特;线 = 0; -brkint -imaxbel iutf8

而 tty7 的设置(X11 的终端是)

速度 38400 波特;线 = 0; 最小值 = 1;时间=0; ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echo -echok -echoctl -echoke

X11/lightdm 可能会在 xinit/startx 期间为 tty7 生成这些设置。如何更改 X11/lightdm 为 tty 生成的终端设置?

干杯,

丹妮

【问题讨论】:

    标签: linux graphics terminal x11


    【解决方案1】:

    如果 X 在 tty7 上运行,您将不会使用它进行 shell 登录。但是您可以更改终端属性(是否有用取决于您对它的使用)。

    假设您有权限,例如,以 root 身份运行:

    stty opost </dev/tty7
    

    也就是说,重定向会在终端上打开一个有效的文件描述符。您可能会看到如下内容:

    $ sudo su -
    [sudo] password for whoever: 
    # stty -a </dev/tty7
    speed 38400 baud; rows 25; columns 80; line = 0;
    intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
    eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
    werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
    -parenb -parodd 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
    # stty opost </dev/tty7
    # stty -a </dev/tty7
    speed 38400 baud; rows 25; columns 80; line = 0;
    intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
    eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
    werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
    -parenb -parodd 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
    

    【讨论】:

    • 我实际上想首先阻止 X11 生成 tty 设置。在 X11 生成了它的 tty 设置之后,我不喜欢“stty -F /dev/tty7 sane”命令。关于在哪里可以找到合适的开关有什么建议吗?
    猜你喜欢
    • 2014-08-08
    • 1970-01-01
    • 1970-01-01
    • 2015-02-14
    • 1970-01-01
    • 2017-08-14
    • 2011-01-26
    • 2013-05-09
    • 1970-01-01
    相关资源
    最近更新 更多