V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
programV2
V2EX  ›  程序员

请问 screen 如何进入回滚模式 , Ctrl-a [ 或者 Ctrl-a ESC 在 ubuntu 16 下都不管用

  •  
  •   programV2 · Nov 27, 2020 · 1599 views
    This topic created in 1988 days ago, the information mentioned may be changed or developed.

    google 了国内外论坛上 都是说用上边的两个按键, 但是我这里按完 Ctrl-a [ 没反应, Ctrl-a ESC 提示 no other window, 有 v 友碰到过的吗? 谢谢

    Supplement 1  ·  Mar 11, 2021
    缓冲区默认是 100 行
    开启 session 时 加参数:
    screen -h 1000

    已经运行的 session 用:
    You can also change the scrollback history size in a running screen with the sequence CTRL-a : (enter screen command-line mode), then scrollback 10000 if you want 10k lines of history buffer. The change applies immediately.

    Be careful of memory usage if you use many screens with very long buffers.

    However, like @William Pursell said, with a currently running screen, once the data has left the buffer, it is gone.
    5 replies    2020-12-02 14:27:23 +08:00
    Sasasu
        1
    Sasasu  
       Nov 27, 2020   ❤️ 1
    假设你的 prefix 是 C-a 。

    正确的按键顺序如下。

    Ctrl 按下 / a 按下 / a 抬起 / Ctrl 抬起 / [ 按下 / [ 抬起
    Sasasu
        2
    Sasasu  
       Nov 27, 2020   ❤️ 1
    Ctrl 按下 / a 按下 / a 抬起 / Ctrl 抬起 / Shift+/ (? 键) 按下 / Shift + / (? 键) 抬起

    可以看到你当前所有的快捷键列表,C-a 意思是同时按下 Ctrl 和 a,空格代表上个操作松开。
    programV2
        3
    programV2  
    OP
       Nov 27, 2020
    @Sasasu 谢谢你, 我还以为同时按, 另外中间的间隔还要控制很短, 好像几 ms 内, 刚刚试了好几次才成功, 谢谢了
    programV2
        4
    programV2  
    OP
       Dec 2, 2020 via iPhone
    You can also run your commands in the script command which will log the output to disk. Or you can: command 2>&1 | tee /tmp/cmd.out to log the output for future investigation in you wanted a (practically) infinite sized output history.

    这种方法有人试过吗?
    programV2
        5
    programV2  
    OP
       Dec 2, 2020 via iPhone
    @Sasasu 谢谢大佬,请问一下 docker log 日志太长,手机 iOS 无法让我在一个屏幕內复制所有日志內容,因为使用方向键移动之后复制出来的内容只能是当前屏幕内容 , 有什么命令可以方便地复制所有日志內容?

    网上搜索到一个 command,但是还是没办法复制到剪切板。
    Journalctl -u docker 2>&1 | tee /tmp/cmd.out
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5503 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 07:02 · PVG 15:02 · LAX 00:02 · JFK 03:02
    ♥ Do have faith in what you're doing.