gpt4 book ai didi

git - Ctrl-t 在终端 "git push"期间显示什么信息?

转载 作者:太空狗 更新时间:2023-10-29 13:52:57 26 4
gpt4 key购买 nike

我从 Mac OS X 终端运行 git。在长时间运行的“git push”过程中,我不小心按下了 ctrl-t,出现了一些“加载”信息。我想这是关于正在运行的进程的某种信息,但我找不到关于它的文档。

信息是什么意思?

运行示例:

danbj$ git push
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 503 bytes | 0 bytes/s, done.
Total 5 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
**load: 1.94 cmd: ssh 30002 waiting 0.01u 0.01s**
load: 2.11 cmd: ssh 30002 waiting 0.01u 0.01s
load: 2.11 cmd: ssh 30002 waiting 0.01u 0.01s
load: 2.10 cmd: ssh 30002 waiting 0.01u 0.01s
load: 2.10 cmd: ssh 30002 waiting 0.01u 0.01s
load: 2.09 cmd: ssh 30002 waiting 0.01u 0.01s
load: 2.09 cmd: ssh 30002 waiting 0.01u 0.01s
load: 2.08 cmd: ssh 30002 waiting 0.01u 0.01s

最佳答案

MacOS 上的 Control-T 来自 BSD。这是 stty 设置中的 status 字符:

$ stty -a
[snip]
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
eol2 = <undef>; erase = ^H; intr = ^C; kill = ^X; lnext = ^V;
min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
stop = ^S; susp = ^Z; time = 0; werase = ^W;

并记录在 termios(4) 中:

 STATUS  Special character on input and is recognized if the ICANON flag
is set. Receipt of this character causes a SIGINFO signal to be
sent to the foreground process group of the terminal. Also, if
the NOKERNINFO flag is not set, it causes the kernel to write a
status message to the terminal that displays the current load
average, the name of the command in the foreground, its process
ID, the symbolic wait channel, the number of user and system sec-
onds used, the percentage of cpu the process is getting, and the
resident set size of the process.

这种状态打印,以及状态字符本身的存在,源 self 和 Rehmi Post 编写的代码(还有其他几个人的输入;Fred Blonder 很可能参与其中,当然还有研究生1980 年代中后期我在马里兰大学时,我们有来自斯坦福大学和麻省理工学院的。 SIGINFO 信号和 NOKERNINFO 控制标志是后来在 1990 年代(甚至可能更晚)添加的。

(我记得,ITSTOPS-10TOPS-20 和/或 TENEX/TWENEX 都有类似的东西。我自己从未使用过其中任何一个,但这就是这个想法的来源。)

关于git - Ctrl-t 在终端 "git push"期间显示什么信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39883417/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com