Giter Club home page Giter Club logo

pyxtermjs's People

Contributors

awsmhacks avatar cs01 avatar florianludwig avatar gilfree avatar joelhoro avatar lochel avatar manics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyxtermjs's Issues

Allow connection from other ports

I'm running pyxtermjs on port 5002 and it works fine in this link
http://localhost:5002

I'm using nginx to proxy port 8083 to port 5002, to be able to access to terminal from port 8083
http://localhost:8083

But here the connection is blocked and it shows this
ERROR (_log_error_once:720) http://localhost:8083 is not an accepted origin. (further occurrences of this error will be logged with level INFO)

I guess it is blocking connections from other ports as a security feature. Is there any way to allow this ?

[Question] Pyxtermjs integration

Hi guys,

thanks for this amazing tool,
I wanted to integrate pyxtermjs on an existing python script already using flask (to avoid to use a reverse proxy using 2 ports)
Is there a simple way for this integration?

Many thanks

Terminal Application Sound Output to Browswer

Thank you for this awesome tool. Is there a straight-forward way to integrate the sound output of Terminal Applications running on pyxtermjs through the browser? Thank you again.

remove pkg-resources==0.0.0 from requirements.txt

following install directions, pip install -r requirements, got error

Could not find a version that satisfies the requirement pkg-resources==0.0.0 (from -r requirements.txt (line 7)) (from versions: )
No matching distribution found for pkg-resources==0.0.0 (from -r requirements.txt (line 7))

Fixed by removing line pkg-resources==0.0.0 from requirements.txt

No module named 'termios'

Tried this on windows 7 and it says no module named 'termios'. Capture
Getting the same error while importing in seperate py file. Also cant install via pip when further researched it is found : no distribution available for windows
Capture2

so for the time it is safe to say that this package is only linux supportive?

Breaks on launching with "Flask run"

The purpose of this issue is to address the ability to port over to another flask application that I have been building. Currently if pyxtermjs is run with the following command the application works just fine.

python3 app.py

image

However when run under flask with the command "flask run" the application looses the interactivity with the shell session.
image

I am wondering why this is and how someone can go through and add/take-away from this base example to include it in an already existing flask application.

Fixed terminal size

Why terminal is not autosized by window size? What is the reason for this behavior?

about pty.fork() function

Hello
I need to implement a web terminal base on flask and use the factory mode to start up the app.
My question is what time the pty.fork() function child_pid equal zero?

your code

(child_pid, fd) = pty.fork()
    if child_pid == 0:
        # this is the child process fork.
        # anything printed here will show up in the pty, including the output
        # of this subprocess
        subprocess.run(app.config["cmd"])
    else:
        # this is the parent process fork.
        # store child fd and pid
        app.config["fd"] = fd
        app.config["child_pid"] = child_pid
        set_winsize(fd, 50, 50)
        cmd = " ".join(shlex.quote(c) for c in app.config["cmd"])
        print("child pid is", child_pid)
        print(
            f"starting background task with command `{cmd}` to continously read "
            "and forward pty output to client"
        )
        socketio.start_background_task(target=read_and_forward_pty_output)
        print("task started")

In my application, I can't launch the subprocess.

How to handle more than one pty child process fork?

I'm in a situation where I have to create child pty fork for each user session. I exactly followed your approach and it's working great but text delay (while on emitting the pty output) happens if more than 3 sessions got opened (in the background it created three child processes). Please help me to overcome this situation. Does making use of async func would help? or do we have to use any low level functions like os.wait() or os.waitpid() ?

[Question] How to get the current path of pty

Thanks for your great work now I am trying to learn and build something cool based on your project.

And now I am facing a problem that I can not solve myself after doing a lot researches...

Let's say the starting path is /User/Example/App

and then the command input sequence from web side is :

cd ..
cd ..

And now the current path should be at /User but how can I get this path using code ?

Any advice will be appreciated, thanks :)

Support for custom CSS

I'd like a command-line argument that lets me specify a custom CSS file to use. For example, I might want to use some CSS that changes the way that the connected/disconnected looks, or I might want to specify a specific font for part of it.

Can a feature please be added to support adding custom CSS into pyxter.js?

Help needed

Hi Chad,
We are using a similar xtermjs application using node js (node-pty) to host the terminal process and SignalR for communication with the web host. I’ve been looking at doing the same thing using python for about a year (!) until I came across pyxtermjs and was super existed.

I’m not a python guru by any means, but I got most of it working, but I got stuck on the initiation where I run into some issues which seems related to threading.
What would it take to get an hour of your time to see if you can point me in the right direction? I’m not looking for a free-bee. I’m happy to reimburse you since I’m really stuck right now.

You can reach me a mikael dot hakansson at axians dot com. or on twitter @wmmihaa

Cheers
Mikael

argparse -"-p", "--port", TypeError: an integer is required (got type str)

>python3 -m pyxtermjs -p 443                                                                                                        
serving on http://127.0.0.1:443
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/klk/.local/lib/python3.6/site-packages/pyxtermjs/__main__.py", line 5, in <module>
    exit(main())
  File "/home/klk/.local/lib/python3.6/site-packages/pyxtermjs/app.py", line 123, in main
    socketio.run(app, debug=args.debug, port=args.port, host=args.host)
  File "/home/klk/.local/lib/python3.6/site-packages/flask_socketio/__init__.py", line 584, in run
    self.wsgi_server.serve_forever()
  File "/usr/local/lib/python3.6/dist-packages/gevent/baseserver.py", line 360, in serve_forever
    self.start()
  File "/usr/local/lib/python3.6/dist-packages/gevent/baseserver.py", line 304, in start
    self.init_socket()
  File "/usr/local/lib/python3.6/dist-packages/gevent/pywsgi.py", line 1451, in init_socket
    StreamServer.init_socket(self)
  File "/usr/local/lib/python3.6/dist-packages/gevent/server.py", line 127, in init_socket
    self.socket = self.get_listener(self.address, self.backlog, self.family)
  File "/usr/local/lib/python3.6/dist-packages/gevent/server.py", line 138, in get_listener
    return _tcp_listener(address, backlog=backlog, reuse_addr=cls.reuse_addr, family=family)
  File "/usr/local/lib/python3.6/dist-packages/gevent/server.py", line 228, in _tcp_listener
    sock.bind(address)
TypeError: an integer is required (got type str)

parser.add_argument("-p", "--port", default=5000, help="port to run server on")

should add `type=int`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.