4 ms·
I've always wondered, would it be reasonable / possible for a shell to run everythhing in a virtual tty? I would love a shell when programs couldn't effect each
by CJefferson 6y ago
I've always wondered, would it be reasonable / possible for a shell to run everythhing in a virtual tty? I would love a shell when programs couldn't effect each other's output, it was easy to dynamically put programs in the background while hiding their output, etc.
- harikb 6y agoIsn’t it what one would get by running screen or tmux? Am I missing something? I guess you mean each command not affecting the very next command that follows?
- CJefferson 6y agoThe problem is i need to know in advance if i want to put something in a seperate window, but that suggests it would be possible.
- mst 6y agoreptyr can reparent a program if you only realise after the fact. I try and remember to have that installed on the heavy-interactive-use servers I admin for when users have an "oshi-" moment because they forgot to start something under screen.
- fiddlerwoaroof 6y agoYou could sort of simulate this with dtach in zsh: zle-line-init() if [[ $CONTEXT = start ]] LBUFFER=$zle_prefix$LBUFFER zle -N zle-line-init mkdir $HOME/dtaches zle_prefix='dtach -A $(mktemp -d $HOME/dtaches/XXXXX)/sock '
- evmar 6y agoI'm working on a shell that does this, for exactly the reasons you gave and more. It doesn't work well enough to announce here, but you can find an index of shells (including others that have had this idea) here: https://github.com/evmar/smash/wiki/Related-projects https://github.com/evmar/smash/wiki/Related-projects
- chubot 6y agoOh interesting, I have been thinking about related things for Oil: Shell as an engine for TUI or GUI https://github.com/oilshell/oil/issues/738 https://github.com/oilshell/oil/issues/738 That came out of a discussion with someone doing a really ambitious overhaul of terminals and display servers (linked in the issue). I believe you could do some interesting things UI-wise with a shell that doesn't run in a terminal itself. The subprocesses would require a terminal, but the shell wouldn't. For example I've heard the suggestion to always keep the prompt at the top of the screen from a few people. That seems like it would be straightforward in an HTML UI, but it probably requires some cooperation from the shell itself. Provide APIs to allow users to write their own line editor / interactive interface https://github.com/oilshell/oil/issues/663 https://github.com/oilshell/oil/issues/663 This is a more Emacs-like architecture for a shell, with the interface being written in a high-level language rather than C/C++. That came out of running parts of ble.sh, which is an interactive shell written in bash !! (I believe it's the biggest bash program in the world, in both number of lines and sophistication) If you have any ideas or suggestions, I'm interested. In the interest of time, I'm cutting out the interactive parts of the project and making it more like a library that other people can build shell UIs on top of. I collected these links awhile ago but haven't done anything with them, there is some overlap: https://github.com/oilshell/oil/wiki/Interactive-Shell https://github.com/oilshell/oil/wiki/Interactive-Shell More shells here: https://github.com/oilshell/oil/wiki/ExternalResources https://github.com/oilshell/oil/wiki/ExternalResources
- nyanpasu64 6y agoI suspect xonsh runs everything in a virtual tty. Full-screen text editors fail to work left and right, like makepkg and possibly sudoedit as well.