什么是 TTY,如何在 Ubuntu 上启用它? [英] What is a TTY and how can I enable it on Ubuntu?

查看:43
本文介绍了什么是 TTY,如何在 Ubuntu 上启用它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在设置一个 node.js 服务器,我在这里使用调试模块 https://github.com/visionmedia/debug.

I'm currently setting up a node.js server and I'm using the debug module here https://github.com/visionmedia/debug.

我正在尝试启用它,以便我可以在输出中获取彩色调试信息,但是我的终端看起来像底部的最后一个终端屏幕,它说:

I'm trying to enable it so I can get the colored debugging information in my output, however my terminal looks like the last terminal screen at the bottom after it says:

When stdout is not a TTY, Date#toUTCString() is used, making it more useful for logging the debug information as shown below:

有人可以对此有所了解吗?谢谢.

Can anyone shed some light on this? Thanks.

推荐答案

tty 是那些时髦的 Unix 命令之一,它将连接到标准输入的终端的名称打印(或显示)到标准输出.

tty is one of those funky Unix commands that prints (or, displays) to standard output the name of the terminal connected to standard input.

这些通常用作访问计算机以修复问题的一种方式,而无需实际登录可能已损坏的桌面.

These are commonly used as a way to get access to the computer to fix things, without actually logging into a possibly b0rked desktop.

相关:命令行中的tty7是什么?

Related: What is tty7 in the commandline?

默认情况下,Ubuntu 有 7 个 tty.

By default Ubuntu has 7 tty's.

1-6 仅是命令行,7 运行您的 X 会话(您的普通桌面).

1-6 are command line only, 7 runs your X session (your normal desktop).

要访问它们,请使用此键盘快捷键:

To access them, use this keyboard shortcut:

Ctrl + Alt + F1

Ctrl + Alt + F1

(将 F1 改为 F1-F6 以访问您需要的终端)

(changing F1 to F1-F6 to access the terminal that you need)

要返回您的 X 会话(普通桌面),

To get back to your X session (the normal desktop),

Ctrl + Alt + F7

Ctrl + Alt + F7

这篇关于什么是 TTY,如何在 Ubuntu 上启用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆