Jump to content




ShellSplit


  • You cannot reply to this topic
14 replies to this topic

#1 Jummit

  • Members
  • 306 posts
  • LocationJulfander Squad Studio

Posted 11 April 2018 - 10:26 AM

This is a small program I made to learn how to multitask. It allows you to split the shell into two horizontally or vertically.
Posted Image
Posted Image
You can not jet close a splited window, simply rebooting (ctrl-r) will fix it.

Download: pastebin get 7pF6tpZ3 split
Usage: split [horizontal/vertical] [program name]
you can also use 1 instead of horizontal and 2 instead of vertical

also, i got a funny imgur id: https://imgur.com/a/bru0S

Edited by Jummit, 11 April 2018 - 01:09 PM.


#2 SquidDev

    Frickin' laser beams | Resident Necromancer

  • Members
  • 1,427 posts
  • LocationDoes anyone put something serious here?

Posted 11 April 2018 - 10:29 AM

The screenshot looks good - reminds me a little bit of i3 (or Emacs's buffers).

It appears the OP is missing a download link - just wondering where one may find the source, I couldn't see it on GitHub either.

Edited by SquidDev, 11 April 2018 - 10:29 AM.


#3 Jummit

  • Members
  • 306 posts
  • LocationJulfander Squad Studio

Posted 11 April 2018 - 10:30 AM

 SquidDev, on 11 April 2018 - 10:29 AM, said:

The screenshot looks good - reminds me a little bit of i3 (or Emacs's buffers).

It appears the OP is missing a download link - just wondering where one may find the source, I couldn't see it on GitHub either.
Its just you being a quicky, and me being someone who always edits the post like four times. :D

Edited by Jummit, 11 April 2018 - 10:30 AM.


#4 SquidDev

    Frickin' laser beams | Resident Necromancer

  • Members
  • 1,427 posts
  • LocationDoes anyone put something serious here?

Posted 11 April 2018 - 10:34 AM

 Jummit, on 11 April 2018 - 10:30 AM, said:

Its just you being a quicky, and me being someone who always edits the post like four times. :D
Sorry! One minor improvement I'd suggest is passing the event to both processes except in a couple of cases (key, key_up, paste, char, terminate, mouse events). This way timers and modem messages will still be processed, but user interaction will not. I see you currently whitelist timers, but it'd probably be better to blacklist the above events instead.

I'd also suggest using table.pack(os.pullEventRaw()) and table.unpack(event, 1, event.n) instead, as these are a little bit more fool-proof when it comes to nil values in events.

Edited by SquidDev, 11 April 2018 - 10:35 AM.


#5 Jummit

  • Members
  • 306 posts
  • LocationJulfander Squad Studio

Posted 11 April 2018 - 10:48 AM

 SquidDev, on 11 April 2018 - 10:34 AM, said:

 Jummit, on 11 April 2018 - 10:30 AM, said:

Its just you being a quicky, and me being someone who always edits the post like four times. :D
Sorry! One minor improvement I'd suggest is passing the event to both processes except in a couple of cases (key, key_up, paste, char, terminate, mouse events). This way timers and modem messages will still be processed, but user interaction will not. I see you currently whitelist timers, but it'd probably be better to blacklist the above events instead.
I give timer events to all programs, but i didn't thought about the other events the user does not generate.

 SquidDev, on 11 April 2018 - 10:34 AM, said:

 Jummit, on 11 April 2018 - 10:30 AM, said:

Its just you being a quicky, and me being someone who always edits the post like four times. :D
I'd also suggest using table.pack(os.pullEventRaw()) and table.unpack(event, 1, event.n) instead, as these are a little bit more fool-proof when it comes to nil values in events.
The code is really crappy, I just wanted to finish it after the frustrating progress of learning how to use coroutines in cc. :blink:

Edited by Jummit, 11 April 2018 - 10:51 AM.


#6 Jummit

  • Members
  • 306 posts
  • LocationJulfander Squad Studio

Posted 11 April 2018 - 11:01 AM

You can not jet close a splited window, simply rebooting (ctrl-r) will fix it.
If a coroutine/program is quit/closed the program will exit instead of freeze.

#7 Jummit

  • Members
  • 306 posts
  • LocationJulfander Squad Studio

Posted 11 April 2018 - 01:09 PM

Oh I really start to love this program:
Posted Image
Fun idea: play worm in such a small window.

Edited by Jummit, 11 April 2018 - 01:11 PM.


#8 Lupus590

  • Members
  • 2,028 posts
  • LocationUK

Posted 11 April 2018 - 01:33 PM

Off topic:

 SquidDev, on 11 April 2018 - 10:34 AM, said:

I'd also suggest using table.pack(os.pullEventRaw()) and table.unpack(event, 1, event.n)...

Should I avoid {os.pullEventRaw()} then?

#9 SquidDev

    Frickin' laser beams | Resident Necromancer

  • Members
  • 1,427 posts
  • LocationDoes anyone put something serious here?

Posted 11 April 2018 - 01:35 PM

 Lupus590, on 11 April 2018 - 01:33 PM, said:

Should I avoid {os.pullEventRaw()} then?
Yep! This PR which fixed CC's behaviour explains the rationale behind it, as well as providing some neat examples of how you should handle it.

#10 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 11 April 2018 - 01:56 PM

This is extremely cool and definitely something that fills the gap of a window manager in CC!
I have one little issue and that has to deal with the cursor, here's an example: https://i.crzd.me/9K7aS4qR.mp4

It seems like the cursor gets stuck at (0, 0), and if i close split it goes back to normal.

#11 Jummit

  • Members
  • 306 posts
  • LocationJulfander Squad Studio

Posted 11 April 2018 - 02:26 PM

 CrazedProgrammer, on 11 April 2018 - 01:56 PM, said:

This is extremely cool and definitely something that fills the gap of a window manager in CC!
Thanks! I didn't expect this to turn out so well, like I said, it is just a program I made to learn coroutines.

 CrazedProgrammer, on 11 April 2018 - 01:56 PM, said:

I have one little issue and that has to deal with the cursor, here's an example: https://i.crzd.me/9K7aS4qR.mp4

It seems like the cursor gets stuck at (0, 0), and if i close split it goes back to normal.
I think I know where this comes from; the blinking cursor can only be displayed on one terminal object. So having multiple terminals with term.setCursorBlink(true) only displays one cursor.

#12 Jummit

  • Members
  • 306 posts
  • LocationJulfander Squad Studio

Posted 12 April 2018 - 06:59 AM

 Jummit, on 11 April 2018 - 02:26 PM, said:

 CrazedProgrammer, on 11 April 2018 - 01:56 PM, said:

This is extremely cool and definitely something that fills the gap of a window manager in CC!
Thanks! I didn't expect this to turn out so well, like I said, it is just a program I made to learn coroutines.

 CrazedProgrammer, on 11 April 2018 - 01:56 PM, said:

I have one little issue and that has to deal with the cursor, here's an example: https://i.crzd.me/9K7aS4qR.mp4

It seems like the cursor gets stuck at (0, 0), and if i close split it goes back to normal.
I think I know where this comes from; the blinking cursor can only be displayed on one terminal object. So having multiple terminals with term.setCursorBlink(true) only displays one cursor.
I fixed it, now the cursor is at the position the program wants it to be, and the cursor is shown on the program that is selected.

#13 Lupus590

  • Members
  • 2,028 posts
  • LocationUK

Posted 12 April 2018 - 09:58 AM

imgur link is borked.

#14 minebuild02

  • Members
  • 97 posts

Posted 20 June 2018 - 09:49 AM

Can I use ShellSplit in my new OS as a primitive window manager?

#15 Jummit

  • Members
  • 306 posts
  • LocationJulfander Squad Studio

Posted 21 June 2018 - 07:38 PM

 minebuild02, on 20 June 2018 - 09:49 AM, said:

Can I use ShellSplit in my new OS as a primitive window manager?
Its just a program, and you can use it in your OS if you want. There is a new window manager I made here, if you want to take a look at it.

EDIT: I saw you posted there already.

Edited by Jummit, 21 June 2018 - 07:39 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users