Code Monkey home page Code Monkey logo

Comments (5)

cronvel avatar cronvel commented on July 20, 2024 1

Can you tell me which OS and terminal you are using? It looks like it does not support the raw mode. Windows?

from terminal-kit.

 avatar commented on July 20, 2024

@cronvel my fault, since windows was not supported and I was on that OS, I was using a ssh client to connect to a linux machine I own, but 100% the terminal of the ssh client was not supported, when I tried on my laptop that has linux on it, it worked like a charm.

( the terminal I was using is from: Bitvise SSH if you are interested to add support or to know which terminal was failing )

Many thanks.

from terminal-kit.

 avatar commented on July 20, 2024

@cronvel do you know if is possible with terminal-kit to send the output something different that process stdoutput?

I explain, I'm trying to archive something like this (pseudo-code):

telnet.createServer(function(client) {
var term = ansi(client, { enabled: true })
term.write('Hello');
})

Using the ansi module is possible to send the output to the telnet client (in this case)

from terminal-kit.

cronvel avatar cronvel commented on July 20, 2024

Hello @codekraft-studio

Have a look at this constructor, it allows you to configure your stdio.

Something like this should do the job:

var termkit = require( 'terminal-kit' ) ;

telnet.createServer(function(client) {
    var term = termkit.createTerminal( {
        stdout: client.stdout ,  // just guessing the 'client' structure here
        stdin: client.stdin ,  // just guessing the 'client' structure here
    } ) ;
    term.magenta( 'Hello! in magenta!' ) ;
} ) ;

If you need advanced features, your telnet lib should at least support the raw mode.

For your windows terminal, can you run some linux text editor with it?

  • If you can't, there is nothing we can do.
  • If you can, then your windows terminal simply has bad default modes, but vanilla Node.js cannot set any TTY mode (beside raw mode), you need a native module for that: the solution can be to use the excellent termios module by @Gottox:

I hesitate to include termios in Terminal-kit, but it bothers me to include native module. At the moment, Terminal-kit can be run on any Node.js machine, but if I include native module, it would require a compiler.

from terminal-kit.

 avatar commented on July 20, 2024

@cronvel

If you can, then your windows terminal simply has bad default modes, but vanilla Node.js cannot set any TTY mode (beside raw mode), you need a native module for that: the solution can be to use the excellent termios module by @Gottox:

with the terminal provided by Bitvise I can use editors like nano and vim via ssh, eventually I will try to use termios if I really need, but for now i'm just "playing" with the code so I don't want to complicate my life too much.

Have a look at this constructor, it allows you to configure your stdio.

I didn't see the documentation in deep, sorry I should have checked before!
Later today when I've time I'll try to see if it works like you suggested many thanks!

from terminal-kit.

Related Issues (20)

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.