-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for resizeChannel in ExecWebSocketListener #1374
Comments
seems like we can construct command with env to initialize terminal size like this:
but without |
@juju812 : Hmm, Could you please create a PR for this? |
@rohanKanojia the workaround is just used for execute bash with tty. If a PR is need, in my view it can be added as an exec example. Or I need to implement the |
@juju812 : if you have time to create PR with full implementation, then please do. Otherwise, we can add workaround as an example too to resolve confusion if someone else faces the same issue. |
@rohanKanojia A quick PR is created for the workaround. And about the |
@juju812 : Much appreciated, Thanks 👍 |
Hello, I now need this function to implement a web terminal that can dynamically change the size. I want to know if k8s supports this function. Which api is specific, I don’t seem to find this api on the k8s offical document.Thanks! @juju812 |
Excuse me, I am bothered again, I looked at the python client implementation,kubernetes-client/python#515,it send message by this way : self.k8s_stream.write_channel(4,
json.dumps({"Height": rows,
"Width": cols})) In our project, it seems that the message is sent in the following way: private void send(byte[] bytes) throws IOException {
if (bytes.length > 0) {
WebSocket ws = webSocketRef.get();
if (ws != null) {
byte[] toSend = new byte[bytes.length + 1];
toSend[0] = 0;
System.arraycopy(bytes, 0, toSend, 1, bytes.length);
ws.send(ByteString.of(toSend));
}
}
} Is this function changed the first bit of the array to 4 and then sends the message? |
hope for this feature...need resize channel too. |
@4qing hi, do you have any idea how to implement this feature? |
@juju812 can you provide the idea of how to implement or some document about this feature,we can help to implement this |
Yes, I have some ideas, but it is limited by my low level, it may be ugly, and I have not participated in the open source project before. If you are willing to wait, I can try to contribute this weekend. @candyleer |
@4qing the resize channel,the streamId is 4? |
yes |
@4qing amazing! does anywhere have the specification for this protocol?, eg, 1 for message 2 for err,3 for errorChannel ,4 for resizeChannel |
I don't know ,I see the python code and try it,and this repo send common data is 0 |
@4qing thanks,recently I need the resize channel too,so I will learn and may make a PR to support this. |
@4qing do you know how to send resize command to the outputstream? that mean how to tell kubenetes we should send a resize command insteam normal commands? |
I know in |
I read the kubenetes code and I know how to do in java client,I will make a PR today |
高山仰止,景行行止,虽不能至,心向往之,阿里就算了,向apache 的commiter致敬! |
@4qing 我能看看你的webTerminal是怎么实现的吗?如何给前端暴露接口。 |
After walk through the
ExecWebSocketListener
I found that currentlyresizeChannel
is not supported.Is there any plan to support it? Or any other work around here to resize tty while bash execution?
Thx.
The text was updated successfully, but these errors were encountered: