docker-console icon indicating copy to clipboard operation
docker-console copied to clipboard

in the terminal curl and vim command can not return anything

Open kelly345 opened this issue 7 years ago • 16 comments

in the terminal curl and vim command can not return anything

kelly345 avatar Aug 25 '17 06:08 kelly345

curl 是没问题,vim的确是有问题。

xianfuxing avatar Dec 01 '17 09:12 xianfuxing

原因 main.js:45 WebSocket connection to 'ws://xxxx:5000/echo' failed: Could not decode a text frame as UTF-8.

xianfuxing avatar Dec 01 '17 09:12 xianfuxing

后来测试发现是python2 对utf-8处理问题。换py3,但无法运行。暂时搁置。找机会用django实现吧。

xianfuxing avatar Dec 06 '17 08:12 xianfuxing

curl肯定是没问题的,vim 及 vi输入中文字符的时候会出现问题,主要是因为xterm.js这个框架对编码格式的支持还不太完善,或是我还不太熟悉这个框架,这个问题我会尽量修复

lanbiter avatar Dec 08 '17 02:12 lanbiter

之前折腾了几天,发现的确是字符集问题,然后很难排查。我想py3应该没问题的,不过gevent好像对py3不怎么友好。这是个好项目, @lanbiter 希望可以解决。

xianfuxing avatar Dec 11 '17 06:12 xianfuxing

lz,不知道有没有搞定这个问题啊,这个不能vim真的很烦人啊。我看了一下你的index.html有引用app.js,但是你项目里没有这个文件,不知道是不是这个问题

hotpot-lyb avatar Dec 18 '17 10:12 hotpot-lyb

resp = self.sock.recv(10240000) 把这个值调大一些就可以用vim了,因为vim时文件内容太多被截断了

kelly345 avatar Dec 18 '17 11:12 kelly345

另外有无可能迁移到python3

xianfuxing avatar Dec 18 '17 11:12 xianfuxing

试了一下,修改了thread_Send.py中的代码,还是不行啊,依然不能用。cz,你是拿的这个lz的代码么?

hotpot-lyb avatar Dec 18 '17 12:12 hotpot-lyb

我就是改了这里,就能vim打开很多大的文件了,包含中文字符的文件没尝试过

kelly345 avatar Dec 18 '17 12:12 kelly345

我就是vim一个新的文件,然后进程就死掉了。。。,一脸懵逼啊。。。用的是py2。

hotpot-lyb avatar Dec 18 '17 13:12 hotpot-lyb

如果你也是在学习这个框架,在做demo,能不能借我看看你这个代码(如果可以的话)多谢了。这个东西困扰我好久了

hotpot-lyb avatar Dec 18 '17 13:12 hotpot-lyb

def run(self):
    while not self.ws.closed:
        try:
            resp = self.sock.recv(10240000)
            if resp is not None and len(resp) is not 0:
                self.ws.send(resp)
            else:
                print 'Connection disconnected...'
                self.ws.send('Connection disconnected...')
                self.ws.close()
                self.sock.close()
        except:
            print 'Connection exception...'
            self.ws.send('Connection exception...')
            self.ws.close()
            self.sock.close()
            break

kelly345 avatar Dec 19 '17 01:12 kelly345

大神啊。。还是不行,还是在vim那里卡在那里。。有没有其他方法解决啊。

hotpot-lyb avatar Dec 19 '17 02:12 hotpot-lyb

WebSocket connection to 'ws://192.168.3.199:5000//echo' failed: Could not decode a text frame as UTF-8. 。他是这个问题

hotpot-lyb avatar Dec 19 '17 07:12 hotpot-lyb

问下你们都能用吗?

ziyilongwang avatar Jun 15 '18 08:06 ziyilongwang