V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
programV2
V2EX  ›  程序员

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

  •  
  •   programV2 · 2020-11-27 16:02:35 +08:00 · 1180 次点击
    这是一个创建于 1239 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    第 1 条附言  ·  2021-03-11 18:34:43 +08:00
    缓冲区默认是 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 条回复    2020-12-02 14:27:23 +08:00
    Sasasu
        1
    Sasasu  
       2020-11-27 16:18:45 +08:00   ❤️ 1
    假设你的 prefix 是 C-a 。

    正确的按键顺序如下。

    Ctrl 按下 / a 按下 / a 抬起 / Ctrl 抬起 / [ 按下 / [ 抬起
    Sasasu
        2
    Sasasu  
       2020-11-27 16:21:10 +08:00   ❤️ 1
    Ctrl 按下 / a 按下 / a 抬起 / Ctrl 抬起 / Shift+/ (? 键) 按下 / Shift + / (? 键) 抬起

    可以看到你当前所有的快捷键列表,C-a 意思是同时按下 Ctrl 和 a,空格代表上个操作松开。
    programV2
        3
    programV2  
    OP
       2020-11-27 17:46:10 +08:00
    @Sasasu 谢谢你, 我还以为同时按, 另外中间的间隔还要控制很短, 好像几 ms 内, 刚刚试了好几次才成功, 谢谢了
    programV2
        4
    programV2  
    OP
       2020-12-02 14:14:52 +08:00 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
       2020-12-02 14:27:23 +08:00 via iPhone
    @Sasasu 谢谢大佬,请问一下 docker log 日志太长,手机 iOS 无法让我在一个屏幕內复制所有日志內容,因为使用方向键移动之后复制出来的内容只能是当前屏幕内容 , 有什么命令可以方便地复制所有日志內容?

    网上搜索到一个 command,但是还是没办法复制到剪切板。
    Journalctl -u docker 2>&1 | tee /tmp/cmd.out
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2802 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 11:59 · PVG 19:59 · LAX 04:59 · JFK 07:59
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.