V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
chenqh
V2EX  ›  Visual Studio Code

vscode 使用 remote 然后在 vscode 的 terminal 里面 ssh,然后 tmux, tmux 显示有问题,有人遇到过吗

  •  
  •   chenqh · 2021-05-10 15:03:24 +08:00 · 3441 次点击
    这是一个创建于 1053 天前的主题,其中的信息可能已经有所发展或是发生改变。

    如题

    弄的我现在要用 terminal 连到 remote 在 ssh 到 server 在 tmux,感觉有点烦躁

    7 条回复    2021-05-11 00:56:44 +08:00
    keller
        1
    keller  
       2021-05-10 15:06:00 +08:00
    remote 以后的终端不就已经是当前服务器的终端环境了吗?
    chenqh
        2
    chenqh  
    OP
       2021-05-10 15:19:10 +08:00
    @keller 我是 remote 的本地 vagrant
    chenqh
        3
    chenqh  
    OP
       2021-05-10 15:21:22 +08:00
    我现在的环境是宿主机是 windows, 开发环境是 windows 的 vagrant(centos), 服务器是是远程 linux
    现在的问题是我用 vscode 连接到 vagrant 开 terminal ssh 连上服务器,在服务器上面使用 tmux, tmux 显示有问题
    xiaoFine
        4
    xiaoFine  
       2021-05-10 17:10:35 +08:00
    我依稀记得 19 年的时候用 vscode 连 tmux 是有显示问题的。。。不知道现在还有没有。
    倒是你的工作流是不是太复杂了,为啥不直接 remote 服务器,或者用 wsl
    ch2
        5
    ch2  
       2021-05-10 17:52:04 +08:00
    vscode 可以指定使用外部 terminal
    chenqh
        6
    chenqh  
    OP
       2021-05-10 18:31:19 +08:00
    @xiaoFine 不复杂呀,就是本地一个虚拟机,在虚拟机上面开发呀
    IgniteWhite
        7
    IgniteWhite  
       2021-05-11 00:56:44 +08:00   ❤️ 1
    一个最基本的需求是 terminfo 的统一。主流(或者说传统)的 terminfo 是 xterm-256color,但是也有很多例外情况。参见 ncurses 官方 terminfo 维护网页 https://invisible-island.net/ncurses/terminfo.src-sections.html

    terminfo 的统一,具体来说是本地 terminal 和远程机设置为同一个 terminfo (对你来说本地 terminal 是 vscode 自带的,远程机需要有足够的 terminfo 的数据文件),tmux 配置文件使用 tmux-256color 作为 terminfo 以避免大部分问题。我写了一个 wiki 页面介绍了 terminfo 获取和配置的须知: https://github.com/g6ai/dotfiles/wiki/terminfo 。同一个 wiki 里也介绍了如何正确配置 tmux,terminal 等等。

    如果 terminfo 的配置不对,使用 tmux 会遇到各种显示问题。推荐的自行解决思路是搞清 vscode 自带 terminal 如何设置的 terminfo,搞清远程机器的 tmux 如何设置的,搞清远程机器是否有相对完备的 terminfo 数据文件,我在 wiki 里有基本介绍。如果需要大家帮助,请提供上述信息,提供问题截图,大家方能帮助。

    terminal TUI 环境的配置的确令人烦躁,不过你不是一个人,tmux,vscode,各个 terminal emulator 的 github issue 和 reddit 板块里有成千上万的帖子在讨论各种细节问题。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3367 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:38 · PVG 21:38 · LAX 06:38 · JFK 09:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.