如何找到当前的虚拟终端

时间:2021-07-05 07:29:39

I am working around a problem in Ubuntu 10.04 where after resume, the mouse cursor disappears.

我正在解决Ubuntu 10.04中的问题,在恢复后,鼠标光标消失。

This can be "fixed" by running chvt 1; chvt 7 in a script in /etc/pm/sleep.d, such that those commands run on thaw and resume.

这可以通过运行chvt 1来“修复”;在/etc/pm/sleep.d的脚本中使用chvt 7,这样命令就可以在解冻和恢复时运行。

However, the X console is not always vt #7, so chvt 7 is wrong in those cases.

但是,X控制台并不总是vt#7,因此在这些情况下chvt 7是错误的。

What I would like to do is find out the current vt in the fix-up script and make sure I change back to that vt.

我想要做的是找出修复脚本中的当前vt,并确保我改回到该vt。

How can I find the current vt? (tty(1) just reports "not a tty")

我怎样才能找到当前的vt? (tty(1)只报告“不是tty”)

1 个解决方案

#1


22  

Check if 'fgconsole' does what you need. Seems to work for me (eg, returns 7 and I'm currently in X)

检查'fgconsole'是否能满足您的需求。似乎为我工作(例如,返回7,我现在在X)

#1


22  

Check if 'fgconsole' does what you need. Seems to work for me (eg, returns 7 and I'm currently in X)

检查'fgconsole'是否能满足您的需求。似乎为我工作(例如,返回7,我现在在X)