GithubHelp home page GithubHelp logo

xtermjs / xterm.js Goto Github PK

View Code? Open in Web Editor NEW
16.7K 197.0 1.6K 27.67 MB

A terminal for the web

Home Page: https://xtermjs.org/

License: MIT License

HTML 0.07% JavaScript 2.07% CSS 0.23% TypeScript 96.73% Python 0.10% Shell 0.80% Procfile 0.01%
xterm terminal development tty console typescript ssh webgl pty vt100

xterm.js's People

Contributors

akalipetis avatar alexr00 avatar andrienkoaleksandr avatar bgw avatar bmf-ribeiro avatar chjj avatar coderaiser avatar dependabot-preview[bot] avatar dependabot[bot] avatar eugeny avatar fgasper avatar javacs3 avatar jeanp413 avatar jerch avatar jmbockhorst avatar kumaran-14 avatar labhanshagrawal avatar lramos15 avatar meganrogge avatar mmis1000 avatar mofux avatar npezza93 avatar parisk avatar perbothner avatar saamalik avatar silamon avatar slawekzachcial avatar tdaglis avatar tisilent avatar tyriar 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  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

xterm.js's Issues

How to connect to a docker container?

Hey,

I like the design of xterm.js and would like to use it to connect to a docker container.
In the documentation I can see that in the client you connect to a docker container using the following uri:
url = 'ws://docker/containers/mycontainer/attach/ws/?stdin=1&stdout=1&stderr=1&logs=1'

As far as I understood there is a server application (e.g., node.js) that's exposing the docker terminal over a socket connection. In the docker documentation I can see that you can connect to a socket container via the docker REST API, so I can do http requests to the docker daemon (http://x.x.x.x:4500/containers/json). But how can I connect to my running container using the socket protocol (ws://x.x.x.x:4500/containers/mycontainer/attach/ws/?stdin=1&stdout=1&stderr=1&logs=1')?

Thanks.

Selection is only possible on the text in the current viewport

While potentially difficult, it's probably possible to do a smooth selection over multiple pages by:

  • Recording start selection position
  • Scroll the terminal up when dragging from terminal and cursor is close to/beyond top
  • Scroll the terminal down when dragging from terminal and cursor is close to/beyond bottom
  • Whenever the terminal is scrolled, reset the selection position
  • When copy is triggered, intercept and select the text between the start and end (probably won't work in older browsers)

Prompt / Newline Bug in Firefox

If you open up the demo page in Firefox (32.0 in Linux Mint) and you hit the enter key there is no newline, instead everything is written on the same line. In Chrome it does work as expected, though.

Make all files ES2015 modules

We could change all files to ES2015 modules. This will help simplify the code base which takes care of commonjs, amd and plain browser environments.

I assume though that if we decide to move on with this it would be a good idea to provide prebuilt files for amd, commonjs and plain browser environment.

Use React in order to render the terminal

We could use React in order to render the terminal.

I guess that we could take advantage of React's Virtual DOM to minify the number of DOM mutations needed when updating the terminal.

We should have in mind though that such a change will dramatically increase the payload of the library.

Resizing the terminal removes lines

Hello!

I'm using xterm in a new Electron-based IDE we're developing for Tingbot. Thanks for the library, it's proving to be super-useful.

I'm running up against some strange behaviour when resizing the terminal, which occurs more often than most terminals due to our window layout - the terminal is a panel at the bottom of the window that slides up and down

When resizing this panel we see unexpected behaviour from the terminal, when it's getting smaller, it removes lines from the top of the scrollback, and when getting bigger, it adds lines to the bottom - so it moves text off the screen if it's closed/opened.

I've had a look at the source and the problem seems to be around xterm.js:2526 - I think the terminal could just adjust its scroll position, rather than adding/removing rows.

I'd be happy to submit a pull request, if somebody could give me a pointer about how the scroll position is stored - I've seen two variables - this.ydisp and this.ybase - what do these do?

Inverse text styles are not applied correctly

I'm using xterm.js in conjunction with ssh2 to build a SSH client, which has been working quite well so far (thanks for the awesome library!). One issue that I have encountered though is that inverse text styles appear as normal text. For example, on nearly any terminal, running nano will show the nano editor with a white status bar across the top implemented using inverse styles. In xterm.js, these appear as normal text instead. This issue also appears when using the colors.js library.

Peeking into the code, the problem seems to lie in the styles being applied by Terminal.prototype.refresh(). For inverse text, the classes applied to the surrounding <span> in each div.xterm-rows is xterm-bg-color-257 xterm-color-256 neither of which are defined in xterm.css and aren't valid xterm-256 colors. The correct classes should be xterm-bg-color-15 xterm-color-0 for a white background with black text.

For nano, the data variable that sets the inverse text in Terminal.prototype.refresh() is 2228992 (I'm not sure if that helps but that seems to be the value that causes bg and fg to evaluate to incorrect values).

How to set terminal colors?

I was looking into using xterm.js for vscode's integrated terminal but the colors seem to be gone after I swapped out jeremyramin/term.js.

image

Expected:

image

This is how I was setting the colors:

terminal.colors = [...]; // array of 16 string in format '#rrggbb'
terminal.refresh(0, terminal.rows);

Fire double backspace event in Safari

Hi, I found a bug in Safari. When I press backspace, "keypress" event fired in Safari. But in Chrome this event is not fired.

We can fix it in keyPress function:


     if (ev.charCode) {
       key = ev.charCode;
     } else if (ev.which == null) {
       key = ev.keyCode;
     } else if (ev.which !== 0 && ev.charCode !== 0) {
       key = ev.which;
     } else {
       return false;
     }

    // fix backspace in Safari
    if (key === 8) {
      return false;
    }

Invert colors on selection

This would make it easier to read in addition to just being plain cool

/* blink/webkit */
.element::selection {
  color: fg;
  background-color: bg;
}
/* -moz-selection (probably deprecated) */

image

Add a "buffered" option to the attach addon

In case a lot of data is being transmitted to the client, consecutive renderings may turn the browser non responsive.

A solution that could work is buffer the the Websocket messages and render them to the terminal 10ms after the first message received. This way the maximum rendering frequency will be every 10ms.

Impossible to select in Firefox

While in Firefox, it is not possible to make a selection in xterm. The selection instantly dissapears.

Firefox 41.0.2
Windows 10

Style issue with ansi characters

Greetings.

I'm sure someone who enjoys css more than me has a better fix for the following, but when I have a terminal app (mcedit is a good example) that brings up a dialog with ansi characters in it the padding seems to blow out.

image

I can fix it with

.xterm-rows div {
    height: 16px;
}

but I imagine it's not the best fix (breaks scaling)

Problem with pipe- and at-character in windows with chrome

Hello,

in Windows (does not matter if virtualized or native) we are having problems with the | and @. While the latter is simply not printed it gives the following output:

altKey: true
bubbles: true
cancelBubble: false
cancelable: true
charCode: 0
ctrlKey: true
currentTarget: null
defaultPrevented: false
detail: 0
eventPhase: 0
keyCode: 81
keyIdentifier: "U+0051"
keyLocation: 0
location: 0
metaKey: false
path: Array[12]
repeat: false
returnValue: true
shiftKey: false
srcElement: textarea.xterm-helper-textarea
target: textarea.xterm-helper-textarea
timeStamp: 1444663462186
type: "keydown"
view: Window
which: 81
proto: KeyboardEvent

For the | key I get no debug output at all for key/ev. In Firefox and in Chrome running Linux it does work fine, though. Any ideas on this?

Cheers

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.