On 12/28/2014 09:12 PM, Jason Spiro wrote: > Rob Landley <rob@...> wrote: >> >> I plan to implement vi over the next year, but it's one of the four >> realy big commands required by posix (sed, awk, sh, vi) and I've been >> debugging sed against real-world data for _weeks_ now. [...] >> >> There are some others (the kernel build requires bc now, if I'm doing >> "less" and "vi" I should be able to do "screen", and "rsync" is really >> useful...) but right now I'm focused on the list for 1.0, and there are >> a lot of smaller commands (and the giant backlog of pending cleanups) >> that could get knocked off the list faster... > > In this message, I will tell you why I think toybox should emulate tmux > instead of GNU Screen. > > Let me begin.
If there are obvious differences beyond key bindings, then I'm probably only interested in the common subset between them. (You can install the big fluffy one if you really need it. I'm not trying to eliminate every other implementation, I'm just trying to establish a simple reliable understandable common base set.) If vi and less can give you navigable screen output (scrolling and redrawing the screen, keeping track of your cursor position, etc), then multi-page support shouldn't be a big deal. That's why it's worth doing, something else we're _already_ doing gets us 80% of the way there. > GNU Screen, a "terminal multiplexer", is very useful. Still, I've since > switched to tmux. It's a newer terminal multiplexer, and is BSD-licensed. And toybox is zero clause BSD/public domain. I'm not using the _source_ of gnu screen. I'm not even looking at the source. (Ick.) I might run the other one under strace to see how it implemented backgrounding/reconnect (network socket? named pipe? Hand off a tty/pty filehandle to the other process through that magic unix domain socket stuff? There's a bunch of ways to do it, I'd rather not have it fail on a system where they forgot to "ifconfig 127.0.0.1 up" nor do I want to have to reserve a magic port number, so network socket's probably out...) > It is true that GNU Screen has now started making releases again for the > first time in half a decade. Still, I like tmux so much that I don't plan > to switch back to Screen. When I say "tar" I mean the command ubuntu has installed. The fact gnu tar went 5 years between releases (even though everybody in the world was patching -j support in for bzip they hadn't bothered, until the fsf's website got broken into and they got kicked awake, and yes I'm the one who notified slashdot way back when: http://developers-beta.slashdot.org/story/03/08/13/1530239/fsf-ftp-site-cracked-looking-for-md5-sums The whole "gee, there should be another implementation of this command I can use instead, one which isn't maintained by crazy people" thing is something I come by naturally. Protesting "but the other implementation sucks", my response is "yes, I know"... > tmux makes certain operations easier.[1] For example: It ships with > preconfigured keybindings (<C-b> 0, <C-b> 1, ..., <C-b> 9) which let you > jump to low-numbered windows in just a few keystrokes. Screen on unbuntu has ctrl-a 1, ctrl-a 2, ctrl-a 3... The first time I used "screen" was on the sun workstations back at college. I have no idea what implementation they were using, and don't really care. As with vi, I learned a half-dozen keybindings and I was going to wait for people to complain about the others missing and use that as a guide of what to add. (Ok, I might read the man page for low hanging fruit. And if there's an actual standard, I implement as much of the standard as is remotely reasonable to do. But I am not adding ebcdic support to dd, I don't care what posix says.) > Another example: To > renumber a window, you need only hit five keys (<C-b> . 9 <RET>), instead of > nine (<C-a> : n u <TAB> 9 <RET>). There may be a way to do that in screen. I never bothered learning how. > tmux is also easier to learn. For example: It shows a status line (tab > bar) by default, instead of forcing users to mess with complex configuration > options just to get a status line. See screenshot[2]. I.E. it eats screen space and screws up your terminal size, so it has to intercept the ansi escape sequence querying that stuff instead of letting it naturally pass to your xterm and let _that_ do it. Despite the wheel reimplementing inherent in the project itself, "I can avoid doing that" still gives me a warm glow. This TLS nonsense makes me grumpy because "avoiding doing that" has developed significant downsides because the internet is changing out from under me (thank you SO much insane NSA voyeurism bugging every single backbone router without a warrant). Possibly at some point I'll need to implement a midnight commander variant, but building it into screen seems odd. (The "windowing system" vs "desktop" dichotomy. You seem to be objecting that screen _isn't_ the textmode version of a desktop.) > tmux is included in the software repositories of Ubuntu, Debian "stable", > and other distros. Trying to remember if screen was installed by default on ubuntu, or if I had to apt-get it. > tmux's basic keybindings are fairly similar to Screen's. But, instead of > Ctrl+A, tmux's default prefix is Ctrl+B. (This is reconfigurable.) This is an argument against screen? > You can find a tmux reference card[3] on the Web. > > Dear Rob: I know you mention Screen in your todo.txt file[4]. But please > consider instead mentioning tmux. Those who are familiar only with good old > Screen can either adapt to the nicer user interface that tmux provides, or > can download and install Screen themselves. Can you summarize the user interface you want? What keybindings do what and how does "detach" work in tmux? With screen I've learned ctrl-a ctrl-a to cycle through windows, ctrl-a c to create a new window, ctrl-a k to kill a window, ctrl-a d to detach, ctrl-a " to get a window list, ctrl-a ESC to let me scroll back up through the window's output above the top of the screen (and then ESC again to exit that), and then to reattach to a named session "screen -dR NAME". Connecting to my server, I generally do: ssh 192.168.1.12 -t screen -dR walrus Which will even bump a previous screen instance if I've got it and give me my persistent stack of running processes. And then when I ctrl-a d (or just suspend my netbook) it detaches and continues running in the background. Presumaly this is all horrible and tmux is better. Could you explain how? > Cheers, > --Jason > > P.S. I thank everyone on this list for maintaining Toybox. My next Android > device will be a more pleasant to work with, thanks to you all. I'm so sorry I'm behind on Anhwini and enh's todo lists (and the whole of pending). I sat down yesterday to clear backlog and hit the fact that the reason I hadn't merged Ashwini's kill patch is kill -l wasn't working, and the reason it wasn't working is when I merged it into killall5 I hit the darn command proessing glitch where kill is working in killall5's flag context an when killall5 is disabled (ala scripts/single.sh) all those FLAG_x macros become 0. I blogged about it: http://landley.net/notes.html#18-10-2014 http://landley.net/notes.html#05-11-2014 and now I have to deal with it... But before I could deal with THAT today I tried to swap in the linux 3.18 kernel in aboriginal and build i686 and SOMEBODY ADDED PERL BACK as a build preprequisite. (I literally spent YEARS getting that removed last time, and they added it back in 3.18-rc6. Right at the END of the build cycle. Honestly...) Bisected it to: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=e6023367d779 And now I have to figure out what (?:) means in perl regex context (I think it means "skip this parenthetical when filling out \1 and \2 and so on), but I need to _confirm_ that to write a reliable replacement in something other than perl? I eventually found it under http://perldoc.perl.org/perlre.html#Extended-Patterns ... > ^ [1]. http://www.techrepublic.com/blog/linux-and-open-source/is-tmux-the- > gnu-screen-killer/ http://en.wikipedia.org/wiki/Betteridge%27s_law_of_headlines > ^ [2]. http://tmux.sf.net/tmux3.png > ^ [3]. http://www.mechanicalkeys.com/files/os/notes/tm.html #3 is a decent cheat sheet... > ^ [4]. http://www.landley.net/code/toybox/todo.txt That todo is from like 2011. The roadmap.html file is much more recent. Rob _______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
