Comments (9)
The committed fix to development branch should at least stop from crashing the server side. However, the restore of the terminal doesn't always work because on socket termination node-pty
usually does cleanup and kills the pty.
node-pty
does have a DESTROY_SOCKET_TIMEOUT_MS = 200;
variable, I need to check how this impacts the session restore of the terminals.
from pylon.
Hi, thanks for reporting - and for trying out cloud9v2 🌟 This is new, I'll take a look. The terminal session restore hasn't properly worked after moving from term.js/pty.js to xterm.js/node-pty. Further more, at least I have an issue as described in #30 where refresh/connection drop causes 100% CPU consumption on the server side when Chrome is used. This has lead me to avoid such scenarios all together but this issue shouldn't happen. Thanks again for reporting.
from pylon.
Can you please try the following patch and let me know if the terminal window survives a refresh:
diff --git a/plugins-server/cloud9.ide.terminal/tty.js b/plugins-server/cloud9.ide.terminal/tty.js
index fbd0ff6..3cd911d 100644
--- a/plugins-server/cloud9.ide.terminal/tty.js
+++ b/plugins-server/cloud9.ide.terminal/tty.js
@@ -220,7 +220,7 @@ Session.prototype.sync = function() {
// terminal has actually been resized.
term.resize(cols + 1, rows + 1);
queue.push(function() {
- term.resize(cols, rows);
+ //term.resize(cols, rows);
});
// Send SIGWINCH to our processes, and hopefully
@@ -329,7 +329,7 @@ Session.prototype.handleMove = function(id, left, top) {
Session.prototype.handleResize = function(id, cols, rows) {
var terms = this.terms;
if (!terms[id]) return;
- terms[id].resize(cols, rows);
+ //terms[id].resize(cols, rows);
terms[id].cols = cols;
terms[id].rows = rows;
};
from pylon.
@exsilium thanks for taking the time for the issue.
results after applying the patch
- after refresh
- terminals are not lost, but
- default to the normal size. (does not retain any previous resizes)
- initially all terminals are blank. I needed to hit enter to see where I was
- after connection drop
- terminals stay in place, but
- when connection is up again, all on screen terminals dissapear.
from pylon.
@exsilium Thank for the partial fix. Also, you said earlier:
The terminal session restore hasn't properly worked after moving from term.js/pty.js to xterm.js/node-pty.
The reason to switch?
Also, I had used the paid c9.io service in the past. This issue did not occur then.
from pylon.
term.js/pty.js
were no longer maintained which prompted the switch. Not sure which version of c9.io you are referring to but the terminal that was used in the v2 stack (before and around 2013) was never released to the public. The current version that c9.io uses wraps the sessions within tmux automatically, thus retaining the terminal sessions (unless something has changed recently).
from pylon.
Thanks @exsilium for the info. Hmm! Tmux seems to be a reliable way to persist sessions. Is there something we can do to achieve this reliability?
One of the primary use cases, I see for this IDE is doing coding in remote server & using its terminal interface to run tasks without logging in with ssh to the machine. But loosing onscreen terminal windows due to connection drop out in midst of some work might be a big problem. I'm curious to know if this problem might be specific to windows.
from pylon.
The scenario you describe is how I also use c9v2. However, i'm not plagued by such frequent disconnections. Couple of things to get around this issue:
- You either develop a habit of going into a
tmux
session whenever using the terminal - You add the following snippet to your
~./bashrc
that does it for you:
# TMUX
if which tmux >/dev/null 2>&1; then
#if not inside a tmux session, and if no session is started, start a new session
test -z "$TMUX" && (tmux attach || tmux new-session)
fi
NB! Before adding this to your .bashrc
file, make sure you do have tmux
installed.
But still, you'd need to re-open a terminal window and resize it every time you lose the connection. Not sure how often you have these kind of interruptions and if these workarounds would be sufficient.
As you mentioned that you use nginx https termination, make sure that the session connect timeout settings are long enough so that the forwarding proxy itself wouldn't be the one disconnecting your sockets. 😉 Cheers!
from pylon.
The original issue submitted is fixed, thus closing.
from pylon.
Related Issues (20)
- PHP syntax highlighting HOT 2
- Can it run in the same server where c9 IDE is present? HOT 2
- [Feature request] Close tab on wheel click
- Linuxserver.io Container HOT 2
- Allow .settings and .sessions to live outside the workspace folder
- Deprecate legacy node version support (v4, v5, v6, v7, v8, v9) HOT 1
- Deprecate the use of optimist HOT 1
- Remove support for node v10
- Deprecate the use of optimist in favor of a more modern option parsing library
- Remove nodeunit plugin and the devDependency
- Upgrade to Ace v1.13.1
- [development] Restore getDisplayIndentGuides() in codeeditor once upstream ace releases fix HOT 1
- Initial session creation is slow due to connect.session.file
- Deprecate usage of Node.js v14-v17 including all @pylonide dependencies
- Allow file preview directly from file tree
- Implement redirect to connect middleware
- install help HOT 6
- Support Forms Authentication HOT 1
- Installation, apf-packager verification fails HOT 1
- Use PPC, deprecate use of APF HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pylon.