Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 09:41
    jcubic opened #799
  • 09:41
    jcubic labeled #799
  • Jun 23 17:30
    KiddoV commented #748
  • Jun 23 17:29
    KiddoV commented #748
  • Jun 23 16:37
    jcubic commented #748
  • Jun 23 14:59
    KiddoV commented #748
  • Jun 23 14:57
    KiddoV commented #748
  • Jun 23 14:56
    KiddoV commented #748
  • Jun 23 14:52
    KiddoV commented #748
  • Jun 23 14:51
    KiddoV commented #748
  • Jun 23 14:42
    KiddoV commented #748
  • Jun 23 14:38
    KiddoV commented #748
  • Jun 23 12:54
    jcubic labeled #798
  • Jun 22 19:37
    jcubic opened #798
  • Jun 22 19:37
    jcubic labeled #798
  • Jun 19 19:19
    jcubic commented #707
  • Jun 19 11:53
    jcubic commented #748
  • Jun 19 11:52
    jcubic commented #748
  • Jun 15 18:58
    jcubic edited #792
Jakub T. Jankiewicz
@jcubic
I was testing locally spend quite a while trying to fix the issue, and it turn out that it's already fixed on dev. I was testing locally with released CSS. When I've switched to dev CSS it works fine. So the actual issue was with blank lines.
So I only need to fix this flush thing where lines were disappearing. IF you can reproduce that it would be great.
Erik Bremen
@strtok
@jcubic i can't use it using the codepen i copied from you - is that codepen using your dev branch? maybe it's fixed
Jakub T. Jankiewicz
@jcubic
No, the CodePen uses the latest release. The version is in the ASCII signature
Erik Bremen
@strtok
@jcubic is there something special that needs to be done so the ctrl-e shortcut works? i think it's also not working in lips demo. it ends up focusing on the browser URL bar
Jakub T. Jankiewicz
@jcubic
It may be the limitation of the brower that don't allow to overwrite some shortcuts, What browser do you use?
porksausagex180
@porksausagex180
Hey, I just posted issue 753 (typing glitch on mobile after animation). I'm curious to know if there's a workaround while it's being looked at?
Jakub T. Jankiewicz
@jcubic
didn't look at it yet, will check maybe tomorrow. Thanks for the reminder.
porksausagex180
@porksausagex180
Okay, I was able to find a workaround--I posted an update to the issue. However, input is still not properly disabled on mobile. and unrelated-- is there a way to disable ctrl+D?
Jakub T. Jankiewicz
@jcubic
If you want default action (which in chrome is adding to bookmarks):
var term = $('body').terminal({}, {
    keymap: {
        'CTRL+D': (e) => {
        }
    }
});
Jakub T. Jankiewicz
@jcubic
@porksausagex180 I'm able to reproduce that input is not disabled on mobile but not an issue with submitting when you type
It's because Android Chrome doesn't use keydown event at all, this is weird but the only way to make it work on mobile is to use the input event and detect the changes.
porksausagex180
@porksausagex180
thanks a lot, that worked for disabling CTRL+D. the sporadic submitting occurs on my samsung phone using chrome browser. but was resolved when I removed those unnecessary js files
Jakub T. Jankiewicz
@jcubic
@porksausagex180 Note that keyboard.js is not unnecessary. Unless you only care about your own phone and not the systems and browsers that users use.
Matheus Fillipe
@matheusfillipe
Hi. When i have a stack of terminals like here: https://terminal.jcubic.pl/examples.php#multiple-interpreters, and the root one has completion: function, defined, the inner terminals inherit the same completion. Is there a way to change or at least deactivate it?
oh nvm, i can set completion to [] or whataver on the inner terminals it seems
this is nice!
tetris-expert
@tetris-expert
Hey, I found your Tetris game and I want to incorporate into my terminal but I'm getting an error of "tetris.Engine is not a constructor" Do you know why?
Jakub T. Jankiewicz
@jcubic
teris game use Teris Engine implementeion of tetris logic, tetris game is just a wrapper around tetrisEngine
I have my own copy in my static assets https://cdn.jsdelivr.net/gh/jcubic/static/js/tetris-engine.js
tetris-expert
@tetris-expert
I included that already...
Jakub T. Jankiewicz
@jcubic
Do you have it online?
tetris-expert
@tetris-expert
I sent it to you privately
Avinal Kumar
@avinal
Hello all, I am trying to clone the foobar website, it seems to use jQuery terminal(a very old version) but using Ember.js as the framework. I am confused how to add jQuery.terminal as a component in Ember.js so that only terminal functions are provided by the package and I can set my own styling to rest of the app. Tried to get some idea from foobar javascript file but its 30k lines of code :confused:
image.png
This is the expected result. Please help
Jakub T. Jankiewicz
@jcubic
Sorry I don't access to foobar and have no idea how to jQuery Terminal with Ember but it would probably be the same as any jQuery plugin
Avinal Kumar
@avinal

I can replicate the UI. If you can give me an idea of how to add in any of the frameworks, let us say react, that would be useful too.
This is the template.

<div class="cmd">

</div>

This is where terminal logic is supposed to go

import Component from '@glimmer/component';
import jQuery from 'jquery';
export default class CommandLineComponent extends Component {

}
Jakub T. Jankiewicz
@jcubic
I have an old ReactJS example https://codepen.io/jcubic/pen/xPepee
I didn't have time to create version with hooks
Avinal Kumar
@avinal
Ok thanks, I will try to get some idea from this and let you know how it goes. :smiley:
Avinal Kumar
@avinal

I was able to figure out something by searches and tries. This is the template.

<div id="test"> </div>
<button {{action "pressed"}}>
Press Me
</button>

And this is the component code.

import Component from '@ember/component';
export default Component.extend({
    actions: {
        pressed: function() {
            $("#test").append("<span>hello</span>");
        }
    }
});

this works fine

image.png
But as soon as I import the terminal and add the most basic code, it does nothing
import Component from '@ember/component';
import terminal from 'jquery.terminal';
import $ from 'jquery';

export default Component.extend({
  actions: {
    pressed: function () {
      $('#test').terminal(
        {
          hello: function (what) {
            this.echo('Hello, ' + what + '. Wellcome to this terminal.');
          },
        },
        {
          greetings: 'My First Web Terminal',
        }
      );
    },
  },
}
);
It prints this error in console
image.png
Jakub T. Jankiewicz
@jcubic
You can't import jQuery Terminal, jQuery is require to create Terminal
If you use different build system you may not need all those hacks and just use simple import but the order is important and terminal return a function that need to be called with jQuery object and window
IF you don't import jQuery the library will import it and you will only need to pass window object
Avinal Kumar
@avinal
Cool, let me try that
Avinal Kumar
@avinal
Hmm I tried it, more errors now, maybe I am doing something wrong. I am going try couple more times and then search for alternatives. I am a system programmer and have a very basic idea about web programming so I don't understand a lot of things, it will take time and all I want is to create an interactive portfolio for now. If you can suggest a way I can use this without a lot of problems, (may or may not be a particular framework), that would be great.
Jakub T. Jankiewicz
@jcubic
If you're system progrmmer and don't know much about the web why you're using Ember?
Avinal Kumar
@avinal
:no_mouth: I just searched framework with jquery support and found ember includes it by default. Also I found the templating easier to learn/use than other frameworks. I can go for framework-less web-app but it would take a lot of time for boilerplate code IG. So ...
Jakub T. Jankiewicz
@jcubic
If you just want full screen terminal and not application with terminal inside, it's easier to use just boilerplate for jQuery Terminal. That in itself is like a framework. You don't use any jQuery code when you use jQuery Terminal
BTW: I find Ember framework that is really hard to learn, I've attempted to learn it twice long time ago, I've had a book but it got outdate pretty quicly. I've given up on Ember
also note that it's not very popular framework
Avinal Kumar
@avinal
Yeah I did experiments with full screen terminal using jquery Terminal and it was nice and easy. but my usecase is little different and there are few more components I want to add so I need terminal inside a particular application. Google seems to have used "SproutCore" framework for creating foo bar.
Jakub T. Jankiewicz
@jcubic
FooBar is really old
Avinal Kumar
@avinal
Yeah, anyway I appreciate all the help and your time. Maybe jquery terminal doesn't fit my usercase or I am too new to use it that way. Apart from that I find it very robust for creating web terminals. I have seen so many examples and they are so good. Thanks, I will see some alternatives.