Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
wsssh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
wsssh
Commits
c2cdde31
Commit
c2cdde31
authored
Sep 13, 2025
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add TERM env and debug output to troubleshoot PTY
parent
c873efa0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
wssshd.py
wssshd.py
+11
-3
No files found.
wssshd.py
View file @
c2cdde31
...
...
@@ -193,30 +193,38 @@ def connect_terminal(client_id):
stdin
=
slave
,
stdout
=
slave
,
stderr
=
slave
,
preexec_fn
=
os
.
setsid
preexec_fn
=
os
.
setsid
,
env
=
dict
(
os
.
environ
,
TERM
=
'xterm'
)
)
os
.
close
(
slave
)
# Start a thread to read output
output_buffer
=
[]
def
read_output
():
output_buffer
.
append
(
f
'Process PID: {proc.pid}
\r\n
'
)
while
proc
.
poll
()
is
None
:
r
,
w
,
e
=
select
.
select
([
master
],
[],
[],
0.1
)
if
master
in
r
:
try
:
data
=
os
.
read
(
master
,
1024
)
if
data
:
output_buffer
.
append
(
data
.
decode
(
'utf-8'
,
errors
=
'ignore'
))
decoded
=
data
.
decode
(
'utf-8'
,
errors
=
'ignore'
)
output_buffer
.
append
(
decoded
)
# Debug: print to server log
print
(
f
"Read data: {repr(decoded)}"
)
except
:
break
# Read any remaining data
try
:
data
=
os
.
read
(
master
,
1024
)
while
data
:
output_buffer
.
append
(
data
.
decode
(
'utf-8'
,
errors
=
'ignore'
))
decoded
=
data
.
decode
(
'utf-8'
,
errors
=
'ignore'
)
output_buffer
.
append
(
decoded
)
print
(
f
"Read remaining: {repr(decoded)}"
)
data
=
os
.
read
(
master
,
1024
)
except
:
pass
output_buffer
.
append
(
'
\r\n
Process finished.
\r\n
'
)
os
.
close
(
master
)
thread
=
threading
.
Thread
(
target
=
read_output
,
daemon
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment