Multihead terminal-based text editors ?

OP
OP
Spartrekus

Spartrekus

Aspiring Daemon

Reaction score: 138
Messages: 916

Hello,

It is actually very simple to make an editor that is multihead and that works over the telnet protocol. About 30 years that vim exists, ... It would be possible to take for instance kilo editor and add a protocol (socket,..) for telnet. Decades ago, terminal programming was popular.

Display it anywhere with telnet myip 8888 or telnet localhost 8888...

It is really so simple to make.
 
OP
OP
Spartrekus

Spartrekus

Aspiring Daemon

Reaction score: 138
Messages: 916

OP
OP
Spartrekus

Spartrekus

Aspiring Daemon

Reaction score: 138
Messages: 916

Because it's not "multihead". It's a single display that's split in two.

It is very useful to collaborate with colleagues on a single file.
If you don't understand then let's continue to use the famous git.
Or test gobby.
(btw, git is owned by Microsoft).

it is actually simple to do.
You open a server listening (basic sockets), that will be your file editor (on a machine, acting as a server).

run : telnet ip port
and then you can distant edit a file as you would do with nano (or vim if it is programmed).

Each client can display the same edited file and allow editing in a collaborative way.
That means that you have a collaborative editor over telnet.

Here an example to run sockets.
 

Hiroo Ono

Member

Reaction score: 6
Messages: 29

I still do not understand well your requirements, but...
If you want two or more GUI windows and share editor buffers between them, running emacs in GUI mode (not emacs -nw in a terminal) may suffice. It can make new 'frame' (as I mentioned 'GUI window') by C-x 5 2 (see https://www.gnu.org/software/emacs/manual/html_node/emacs/Creating-Frames.html).
If what you want to do is that running an editor and later logging in from remote and running another editor that shares the buffers with the previous one, emacs-server and emacsclient might help you (see https://www.gnu.org/software/emacs/manual/html_node/emacs/Invoking-emacsclient.html#Invoking-emacsclient).
Off course the former can be achieved with two or more terminal windows, emacs-server and emacsclient.
 

roccobaroccoSC

Well-Known Member

Reaction score: 93
Messages: 413

Your problem is in fact you need a clipboard that works across terminal sessions. Because the text editors are per se quite simple. They take whatever terminal window you start them in.

Regarding the root question: it depends if you're using X or not. I use in all my consoles (inside X) the standard Xorg clipboard and the program xclip, which pipes input and output to and from the clipboard. I do selection and I use Shift-Ctrl-C for copy and Shift-Ctrl-V for paste.

If you want to use a clipboard in text mode without X - I have not done it and I don't know how to do it. For me it is a non-issue, because I always edit in an X. If I administer a machine that has no X, I just login from my graphical console remotely and do whatever I want.
If I really have to go on a textual terminal, I edit what I edit, then I pipe the text to a file and this can be read from any other console. But this is definitely not my preferred mode of work.

For multihead - I LOVE monitors. The more, the better. I personally use 4 screens, but I would gladly have 2 more above them if it were easy. It's just nice to have, so I have not done it.

Hello,

vim or emacs are "single" oriented monitor. Eventually one can use screen but the text editor works on a single monitor anyhow.

Do you know a possible multihead terminal-based text editor?

Concept would be that each monitor can open a file and they works alltogether (copy/cut,...) in a single terminal based application.

Feel free...




It would be possible to use sockets for instance and to display on any distant or local machine the buffers of the editor. A multihead editor could be made in just 2000 lines, largest maximum.
It could maybe just take 1 or maybe 2 hours to realize such an application. Surprising that an editor server like early vi-clone over telnet (buffers, hjkl, ...) is not yet existing.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h> 
#include <arpa/inet.h>  
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/time.h>
 
OP
OP
Spartrekus

Spartrekus

Aspiring Daemon

Reaction score: 138
Messages: 916

I still do not understand well your requirements, but...
If you want two or more GUI windows and share editor buffers between them, running emacs in GUI mode (not emacs -nw in a terminal) may suffice. It can make new 'frame' (as I mentioned 'GUI window') by C-x 5 2 (see https://www.gnu.org/software/emacs/manual/html_node/emacs/Creating-Frames.html).
If what you want to do is that running an editor and later logging in from remote and running another editor that shares the buffers with the previous one, emacs-server and emacsclient might help you (see https://www.gnu.org/software/emacs/manual/html_node/emacs/Invoking-emacsclient.html#Invoking-emacsclient).
Off course the former can be achieved with two or more terminal windows, emacs-server and emacsclient.
thank you very much !!
it looks really very great to use the buffers.

However, there are not working things, as follows:

the problem is that I do want to share the same machine or either the same login session.

The best is to run the unsecured, no password, access that it is easily done over telnet, because then I do not need to create a new user.
+ the colleague can run windows if he wants (to testament himself.
The issue is that they are many files with clear passwords in the getenv( "HOME" ) / home user dir.
 
OP
OP
Spartrekus

Spartrekus

Aspiring Daemon

Reaction score: 138
Messages: 916

Your problem is in fact you need a clipboard that works across terminal sessions. Because the text editors are per se quite simple. They take whatever terminal window you start them in.

Regarding the root question: it depends if you're using X or not. I use in all my consoles (inside X) the standard Xorg clipboard and the program xclip, which pipes input and output to and from the clipboard. I do selection and I use Shift-Ctrl-C for copy and Shift-Ctrl-V for paste.

If you want to use a clipboard in text mode without X - I have not done it and I don't know how to do it. For me it is a non-issue, because I always edit in an X. If I administer a machine that has no X, I just login from my graphical console remotely and do whatever I want.
If I really have to go on a textual terminal, I edit what I edit, then I pipe the text to a file and this can be read from any other console. But this is definitely not my preferred mode of work.

For multihead - I LOVE monitors. The more, the better. I personally use 4 screens, but I would gladly have 2 more above them if it were easy. It's just nice to have, so I have not done it.
Our project pics are located on a distant (tunnel) over SSHFS.


how do you "see" the PNG file of a latex doc if you have six FreeBSD console?

I do not know any "FBI" or "feh for framebuffer" running into vim ?
 
OP
OP
Spartrekus

Spartrekus

Aspiring Daemon

Reaction score: 138
Messages: 916

who cares?

there is at least 6 to 10 firewalls to pass, and lot of admins to protect ;)
No one can hack and bypass to get access "in"
 
OP
OP
Spartrekus

Spartrekus

Aspiring Daemon

Reaction score: 138
Messages: 916

The open source program git is owned by msft?
"GitHub is one of the largest code hosts in the world with over 100 million* projects. Private, public, or open source, all repositories are equipped with tools to help you host, version, and release code."
Opensource hosted by a Microsoft Service.

It is a bit like a Linux conference where servers are powered by Microsoft servers. It is not congruent that much. What kind of other choice besides? There aren't much.
 
OP
OP
Spartrekus

Spartrekus

Aspiring Daemon

Reaction score: 138
Messages: 916

Your problem is in fact you need a clipboard that works across terminal sessions. Because the text editors are per se quite simple. They take whatever terminal window you start them in.

Regarding the root question: it depends if you're using X or not. I use in all my consoles (inside X) the standard Xorg clipboard and the program xclip, which pipes input and output to and from the clipboard. I do selection and I use Shift-Ctrl-C for copy and Shift-Ctrl-V for paste.

If you want to use a clipboard in text mode without X - I have not done it and I don't know how to do it. For me it is a non-issue, because I always edit in an X. If I administer a machine that has no X, I just login from my graphical console remotely and do whatever I want.
If I really have to go on a textual terminal, I edit what I edit, then I pipe the text to a file and this can be read from any other console. But this is definitely not my preferred mode of work.

For multihead - I LOVE monitors. The more, the better. I personally use 4 screens, but I would gladly have 2 more above them if it were easy. It's just nice to have, so I have not done it.

how do you do from vim (editing tex document) to another console (another distant machine) and display the PNG of current line using cacaview ?
 

roccobaroccoSC

Well-Known Member

Reaction score: 93
Messages: 413

how do you do from vim (editing tex document) to another console (another distant machine) and display the PNG of current line using cacaview ?
I don't know vim at all. I just know to press 'dd' for deleting current line and ':wq' to exit. I started learning emacs and found it quite neat but it takes a lot of time and this is what I don't have at the moment.
 

roccobaroccoSC

Well-Known Member

Reaction score: 93
Messages: 413

Our project pics are located on a distant (tunnel) over SSHFS.
how do you "see" the PNG file of a latex doc if you have six FreeBSD console?
I do not know any "FBI" or "feh for framebuffer" running into vim ?
I must rephrase what I wrote. I love multihead and I use 4 displays at the moment (no 6, which would be nice to have).
I definitely use Xorg and graphical consoles. So I bind them with the Xorg buffer when copying and pasting. I think KDE has an applet that offers multiple buffers but I have not used it so far.
How to join your 6 consoles to display for example one single PNG via cacaview? That's an interesting question and I have no answer for this. If using Xorg it should be possible to create a terminal window spanning over all displays and then you could display it in a single console on multiple displays. I don't know how to split the image on many consoles.
 
OP
OP
Spartrekus

Spartrekus

Aspiring Daemon

Reaction score: 138
Messages: 916

I must rephrase what I wrote. I love multihead and I use 4 displays at the moment (no 6, which would be nice to have).
I definitely use Xorg and graphical consoles. So I bind them with the Xorg buffer when copying and pasting. I think KDE has an applet that offers multiple buffers but I have not used it so far.
How to join your 6 consoles to display for example one single PNG via cacaview? That's an interesting question and I have no answer for this. If using Xorg it should be possible to create a terminal window spanning over all displays and then you could display it in a single console on multiple displays. I don't know how to split the image on many consoles.
Several monitors is actually good. I use to have consoles, for just C.

With colleagues, we perform some tex document and code writing using svn. Collaborative would work too well actually better sometimes to work directly together in real time (on an highly secured small intranet behing router, explaining no security issue).
 

roccobaroccoSC

Well-Known Member

Reaction score: 93
Messages: 413

Several monitors is actually good. I use to have consoles, for just C.

With colleagues, we perform some tex document and code writing using svn. Collaborative would work too well actually better sometimes to work directly together in real time (on an highly secured small intranet behing router, explaining no security issue).
I use VNC in such scenarios. But I must admit, I have not been involved in distributed development with >1 colleague at a time in my Unix work.
I used telcos quite a while back on my old job, but we telcoed via MS Lync and it's a totally different beast.
 
Top