327 posts
Location
Julfander Squad Studio
Posted 11 April 2018 - 11: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.You can not jet close a splited window, simply rebooting (ctrl-r) will fix it.
Download:
pastebin get 7pF6tpZ3 splitUsage: split [horizontal/vertical] [program name]you can also use 1 instead of horizontal and 2 instead of verticalalso, i got a funny imgur id: https://imgur.com/a/bru0S
Edited on 11 April 2018 - 12:09 PM
1426 posts
Location
Does anyone put something serious here?
Posted 11 April 2018 - 11: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 on 11 April 2018 - 09:29 AM
327 posts
Location
Julfander Squad Studio
Posted 11 April 2018 - 11:30 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.
Its just you being a quicky, and me being someone who always edits the post like four times. :D/>
Edited on 11 April 2018 - 09:30 AM
1426 posts
Location
Does anyone put something serious here?
Posted 11 April 2018 - 11:34 AM
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 on 11 April 2018 - 09:35 AM
327 posts
Location
Julfander Squad Studio
Posted 11 April 2018 - 11:48 AM
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.
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 on 11 April 2018 - 09:51 AM
327 posts
Location
Julfander Squad Studio
Posted 11 April 2018 - 12:01 PM
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.
327 posts
Location
Julfander Squad Studio
Posted 11 April 2018 - 02:09 PM
Oh I really start to love this program:
Fun idea: play worm in such a small window.
Edited on 11 April 2018 - 12:11 PM
2427 posts
Location
UK
Posted 11 April 2018 - 02:33 PM
Off topic:
I'd also suggest using table.pack(os.pullEventRaw()) and table.unpack(event, 1, event.n)…
Should I avoid
{os.pullEventRaw()} then?
1426 posts
Location
Does anyone put something serious here?
Posted 11 April 2018 - 02:35 PM
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.
546 posts
Location
Wageningen, The Netherlands
Posted 11 April 2018 - 02: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.mp4It seems like the cursor gets stuck at (0, 0), and if i close split it goes back to normal.
327 posts
Location
Julfander Squad Studio
Posted 11 April 2018 - 03:26 PM
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.
I have one little issue and that has to deal with the cursor, here's an example:
https://i.crzd.me/9K7aS4qR.mp4It 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.
327 posts
Location
Julfander Squad Studio
Posted 12 April 2018 - 07:59 AM
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.
I have one little issue and that has to deal with the cursor, here's an example:
https://i.crzd.me/9K7aS4qR.mp4It 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.
2427 posts
Location
UK
Posted 12 April 2018 - 10:58 AM
imgur link is borked.
100 posts
Posted 20 June 2018 - 10:49 AM
Can I use ShellSplit in my new OS as a primitive window manager?
327 posts
Location
Julfander Squad Studio
Posted 21 June 2018 - 08:38 PM
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 on 21 June 2018 - 06:39 PM