简体   繁体   English

末尾有奇怪的鱼尾字符/鱼 shell 输出 ⏎

[英]Fish weird endline character at end / Fish shell outputs ⏎

I have a Python script that prints some numbers, like this:我有一个打印一些数字的 Python 脚本,如下所示:

results = [42, 21, 64, 32, 16, 8, 4, 2]
for number in results:
    print(number, end=' ')

In the console, the output of this script is:在控制台中,这个脚本的output是:

42 21 64 32 16 8 4 2 ⏎ 

Why is there a weird character at the end?为什么最后会有一个奇怪的角色?

My IDE is LunarVim.我的 IDE 是 LunarVim。 My shell is Fish.我的 shell 是鱼。

Fish shell outputs ⏎ 鱼 shell 输出 ⏎

This is essentially fish's way of telling you that there is no trailing newline or "\n".这本质上是鱼告诉您没有尾随换行符或“\n”的方式。 Using print() will probably not result in this.使用 print() 可能不会导致这种情况。 In bash, the terminal may start after the output, instead of the next line.在 bash 中,终端可能会在 output 之后启动,而不是下一行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM