Is emacs a terminal multiplexer? [closed]

Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
Two distinguishing features of terminal multiplexer from regular terminal emulator is that you can move a session from terminal to terminal over network, and you can share a session with other users/connections.
Emacs can be used as a terminal emulator to run a shell to execute programs.
Moreover, I have used emacs this way. Start an emacs daemon, and connect to it from any terminal emulator window. In that sense, I can move an emacs session from terminal emulator window to terminal emulator window. I have only done so on my local machine, so can I move an emacs session from terminal to terminal over network, just like a terminal multiplexer?
Is emacs a terminal multiplexer, except that maybe I can only have one emacs session instead of multiple emacs sessions on the same machine?
Is there any benefit of using emacs under another terminal multiplexer such as Screen or Tmux? Or the other way around? Or shall I just use emacs standalone?
Is emacs as a terminal emulator/multiplexer implemented based on pseudoterminal?
Thanks.
emacs terminal-emulator terminal-multiplexer pseudoterminal
closed as primarily opinion-based by Stephen Harris, thrig, Thomas Dickey, G-Man, dirkt Nov 29 at 10:33
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
-1
down vote
favorite
Two distinguishing features of terminal multiplexer from regular terminal emulator is that you can move a session from terminal to terminal over network, and you can share a session with other users/connections.
Emacs can be used as a terminal emulator to run a shell to execute programs.
Moreover, I have used emacs this way. Start an emacs daemon, and connect to it from any terminal emulator window. In that sense, I can move an emacs session from terminal emulator window to terminal emulator window. I have only done so on my local machine, so can I move an emacs session from terminal to terminal over network, just like a terminal multiplexer?
Is emacs a terminal multiplexer, except that maybe I can only have one emacs session instead of multiple emacs sessions on the same machine?
Is there any benefit of using emacs under another terminal multiplexer such as Screen or Tmux? Or the other way around? Or shall I just use emacs standalone?
Is emacs as a terminal emulator/multiplexer implemented based on pseudoterminal?
Thanks.
emacs terminal-emulator terminal-multiplexer pseudoterminal
closed as primarily opinion-based by Stephen Harris, thrig, Thomas Dickey, G-Man, dirkt Nov 29 at 10:33
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
If you don't understand my post at this moment, it is completely okay. Please try your best not to close it and leave some open air.
– Tim
Nov 29 at 3:15
Please help to reopen, and/or reply in comments if you have any idea. Thanks.
– Tim
Nov 29 at 3:19
"Is X an Y?" depends on your definition of Y (and different people may have different definitions). "Is there a benefit to Z?" mostly depends on your taste - there are often several ways to achieve the same thing. How are we supposed to answer this question objectively? You can use emacs and/or screen/tmux in any way you please. The only part that has an objective answer would be if emacs uses a pty (instead of, say, a pipe) to run a shell subprocess, but that's really a detail.
– dirkt
Nov 29 at 10:33
FWIW, You can have more than one emacs session on the same machine; eg. start the server with--daemon=foothen attach to it withemacsclient -c -s foo.
– mosvy
Nov 29 at 18:48
Andemacsis of course, using pseudo-terminals to implement itsshellandtermcommands. There's no other way to do it.
– mosvy
Nov 29 at 18:58
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
Two distinguishing features of terminal multiplexer from regular terminal emulator is that you can move a session from terminal to terminal over network, and you can share a session with other users/connections.
Emacs can be used as a terminal emulator to run a shell to execute programs.
Moreover, I have used emacs this way. Start an emacs daemon, and connect to it from any terminal emulator window. In that sense, I can move an emacs session from terminal emulator window to terminal emulator window. I have only done so on my local machine, so can I move an emacs session from terminal to terminal over network, just like a terminal multiplexer?
Is emacs a terminal multiplexer, except that maybe I can only have one emacs session instead of multiple emacs sessions on the same machine?
Is there any benefit of using emacs under another terminal multiplexer such as Screen or Tmux? Or the other way around? Or shall I just use emacs standalone?
Is emacs as a terminal emulator/multiplexer implemented based on pseudoterminal?
Thanks.
emacs terminal-emulator terminal-multiplexer pseudoterminal
Two distinguishing features of terminal multiplexer from regular terminal emulator is that you can move a session from terminal to terminal over network, and you can share a session with other users/connections.
Emacs can be used as a terminal emulator to run a shell to execute programs.
Moreover, I have used emacs this way. Start an emacs daemon, and connect to it from any terminal emulator window. In that sense, I can move an emacs session from terminal emulator window to terminal emulator window. I have only done so on my local machine, so can I move an emacs session from terminal to terminal over network, just like a terminal multiplexer?
Is emacs a terminal multiplexer, except that maybe I can only have one emacs session instead of multiple emacs sessions on the same machine?
Is there any benefit of using emacs under another terminal multiplexer such as Screen or Tmux? Or the other way around? Or shall I just use emacs standalone?
Is emacs as a terminal emulator/multiplexer implemented based on pseudoterminal?
Thanks.
emacs terminal-emulator terminal-multiplexer pseudoterminal
emacs terminal-emulator terminal-multiplexer pseudoterminal
edited Nov 28 at 13:02
asked Nov 28 at 12:16
Tim
25.3k72243446
25.3k72243446
closed as primarily opinion-based by Stephen Harris, thrig, Thomas Dickey, G-Man, dirkt Nov 29 at 10:33
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as primarily opinion-based by Stephen Harris, thrig, Thomas Dickey, G-Man, dirkt Nov 29 at 10:33
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
If you don't understand my post at this moment, it is completely okay. Please try your best not to close it and leave some open air.
– Tim
Nov 29 at 3:15
Please help to reopen, and/or reply in comments if you have any idea. Thanks.
– Tim
Nov 29 at 3:19
"Is X an Y?" depends on your definition of Y (and different people may have different definitions). "Is there a benefit to Z?" mostly depends on your taste - there are often several ways to achieve the same thing. How are we supposed to answer this question objectively? You can use emacs and/or screen/tmux in any way you please. The only part that has an objective answer would be if emacs uses a pty (instead of, say, a pipe) to run a shell subprocess, but that's really a detail.
– dirkt
Nov 29 at 10:33
FWIW, You can have more than one emacs session on the same machine; eg. start the server with--daemon=foothen attach to it withemacsclient -c -s foo.
– mosvy
Nov 29 at 18:48
Andemacsis of course, using pseudo-terminals to implement itsshellandtermcommands. There's no other way to do it.
– mosvy
Nov 29 at 18:58
add a comment |
If you don't understand my post at this moment, it is completely okay. Please try your best not to close it and leave some open air.
– Tim
Nov 29 at 3:15
Please help to reopen, and/or reply in comments if you have any idea. Thanks.
– Tim
Nov 29 at 3:19
"Is X an Y?" depends on your definition of Y (and different people may have different definitions). "Is there a benefit to Z?" mostly depends on your taste - there are often several ways to achieve the same thing. How are we supposed to answer this question objectively? You can use emacs and/or screen/tmux in any way you please. The only part that has an objective answer would be if emacs uses a pty (instead of, say, a pipe) to run a shell subprocess, but that's really a detail.
– dirkt
Nov 29 at 10:33
FWIW, You can have more than one emacs session on the same machine; eg. start the server with--daemon=foothen attach to it withemacsclient -c -s foo.
– mosvy
Nov 29 at 18:48
Andemacsis of course, using pseudo-terminals to implement itsshellandtermcommands. There's no other way to do it.
– mosvy
Nov 29 at 18:58
If you don't understand my post at this moment, it is completely okay. Please try your best not to close it and leave some open air.
– Tim
Nov 29 at 3:15
If you don't understand my post at this moment, it is completely okay. Please try your best not to close it and leave some open air.
– Tim
Nov 29 at 3:15
Please help to reopen, and/or reply in comments if you have any idea. Thanks.
– Tim
Nov 29 at 3:19
Please help to reopen, and/or reply in comments if you have any idea. Thanks.
– Tim
Nov 29 at 3:19
"Is X an Y?" depends on your definition of Y (and different people may have different definitions). "Is there a benefit to Z?" mostly depends on your taste - there are often several ways to achieve the same thing. How are we supposed to answer this question objectively? You can use emacs and/or screen/tmux in any way you please. The only part that has an objective answer would be if emacs uses a pty (instead of, say, a pipe) to run a shell subprocess, but that's really a detail.
– dirkt
Nov 29 at 10:33
"Is X an Y?" depends on your definition of Y (and different people may have different definitions). "Is there a benefit to Z?" mostly depends on your taste - there are often several ways to achieve the same thing. How are we supposed to answer this question objectively? You can use emacs and/or screen/tmux in any way you please. The only part that has an objective answer would be if emacs uses a pty (instead of, say, a pipe) to run a shell subprocess, but that's really a detail.
– dirkt
Nov 29 at 10:33
FWIW, You can have more than one emacs session on the same machine; eg. start the server with
--daemon=foo then attach to it with emacsclient -c -s foo.– mosvy
Nov 29 at 18:48
FWIW, You can have more than one emacs session on the same machine; eg. start the server with
--daemon=foo then attach to it with emacsclient -c -s foo.– mosvy
Nov 29 at 18:48
And
emacs is of course, using pseudo-terminals to implement its shell and term commands. There's no other way to do it.– mosvy
Nov 29 at 18:58
And
emacs is of course, using pseudo-terminals to implement its shell and term commands. There's no other way to do it.– mosvy
Nov 29 at 18:58
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Barring their graphical variants, vi, and most other editors that provide shell functionality work significantly differently from a terminal multiplexer. They don't actually emulate terminals themselves, they just provide a way to run other programs on the same terminal that they are already running in.
All of this functionality is essentially implemented using the system() function provided by libc (defined by both POSIX and ANSI C, check man 3 system for more info). In short, when you call this function from a program, it suspends your current program, and then starts the requested command as a subprocess of your program. Until that command terminates, the original program completely stops execution and ignores all input. By operating this way, the new command can use the terminal you were running the original program in without needing any kind of terminal emulation.
Based on comments, EMACS, on the other hand, is a bit of an odd exception. As is typical of their development style, they apparently actually handle this completely differently, and do in fact use a PTY for normal command callout functionality, though it only emulates a 'dumb' terminal.
They also appear to have full terminal emulation support, so in theory you can use EMACS as a terminal multiplexer, though I somewhat doubt that it will be anywhere near as efficient as a dedicated terminal emulator (at minimum, it will use more RAM, because EMACS is huge).
1
Emacs’M-x shellemulates a dumb terminal inside an Emacs buffer, even when Emacs is running inside a terminal itself. The rest of Emacs continues executing in parallel with whatever is running inside the buffer.
– Stephen Kitt
Nov 29 at 8:25
1
@StephenKitt there's alsoM-x termandM-x ansi-termwhich offers a full terminal emulation. You can even run another emacs inside it. You can also startemacsin server mode, then runemacsclient -cto attach to it. So, while it's true that emacs lacks a decent editor, it's perfectly able to act as a terminal emulator and multiplexer and replace screen and tmux;-)
– mosvy
Nov 29 at 18:31
@mosvy so you can run Vim inside an Emacs terminal ;-).
– Stephen Kitt
Nov 29 at 18:33
Answer has been updated to include info about EMACS. As usual, they're weird and have to be the exception to almost everything...
– Austin Hemmelgarn
Nov 29 at 19:19
1
@AustinHemmelgarn a) it's not true that emacs is only implementing a dumb terminal b) it's not true that emacs is always using ptys when running external commands c) it's not true thatviand other editors are using system(3) for "command callout" functionality -- in fact, it would be impossible to implement!motion cmd,:range!cmd,:w !cmdandr !cmdinviwith system(3).viisn't even using system(3) for the simple:!cmd, because that's using the user's$SHELL, not necessarily/bin/shas used by system(3).
– mosvy
Nov 29 at 22:15
|
show 2 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Barring their graphical variants, vi, and most other editors that provide shell functionality work significantly differently from a terminal multiplexer. They don't actually emulate terminals themselves, they just provide a way to run other programs on the same terminal that they are already running in.
All of this functionality is essentially implemented using the system() function provided by libc (defined by both POSIX and ANSI C, check man 3 system for more info). In short, when you call this function from a program, it suspends your current program, and then starts the requested command as a subprocess of your program. Until that command terminates, the original program completely stops execution and ignores all input. By operating this way, the new command can use the terminal you were running the original program in without needing any kind of terminal emulation.
Based on comments, EMACS, on the other hand, is a bit of an odd exception. As is typical of their development style, they apparently actually handle this completely differently, and do in fact use a PTY for normal command callout functionality, though it only emulates a 'dumb' terminal.
They also appear to have full terminal emulation support, so in theory you can use EMACS as a terminal multiplexer, though I somewhat doubt that it will be anywhere near as efficient as a dedicated terminal emulator (at minimum, it will use more RAM, because EMACS is huge).
1
Emacs’M-x shellemulates a dumb terminal inside an Emacs buffer, even when Emacs is running inside a terminal itself. The rest of Emacs continues executing in parallel with whatever is running inside the buffer.
– Stephen Kitt
Nov 29 at 8:25
1
@StephenKitt there's alsoM-x termandM-x ansi-termwhich offers a full terminal emulation. You can even run another emacs inside it. You can also startemacsin server mode, then runemacsclient -cto attach to it. So, while it's true that emacs lacks a decent editor, it's perfectly able to act as a terminal emulator and multiplexer and replace screen and tmux;-)
– mosvy
Nov 29 at 18:31
@mosvy so you can run Vim inside an Emacs terminal ;-).
– Stephen Kitt
Nov 29 at 18:33
Answer has been updated to include info about EMACS. As usual, they're weird and have to be the exception to almost everything...
– Austin Hemmelgarn
Nov 29 at 19:19
1
@AustinHemmelgarn a) it's not true that emacs is only implementing a dumb terminal b) it's not true that emacs is always using ptys when running external commands c) it's not true thatviand other editors are using system(3) for "command callout" functionality -- in fact, it would be impossible to implement!motion cmd,:range!cmd,:w !cmdandr !cmdinviwith system(3).viisn't even using system(3) for the simple:!cmd, because that's using the user's$SHELL, not necessarily/bin/shas used by system(3).
– mosvy
Nov 29 at 22:15
|
show 2 more comments
up vote
0
down vote
Barring their graphical variants, vi, and most other editors that provide shell functionality work significantly differently from a terminal multiplexer. They don't actually emulate terminals themselves, they just provide a way to run other programs on the same terminal that they are already running in.
All of this functionality is essentially implemented using the system() function provided by libc (defined by both POSIX and ANSI C, check man 3 system for more info). In short, when you call this function from a program, it suspends your current program, and then starts the requested command as a subprocess of your program. Until that command terminates, the original program completely stops execution and ignores all input. By operating this way, the new command can use the terminal you were running the original program in without needing any kind of terminal emulation.
Based on comments, EMACS, on the other hand, is a bit of an odd exception. As is typical of their development style, they apparently actually handle this completely differently, and do in fact use a PTY for normal command callout functionality, though it only emulates a 'dumb' terminal.
They also appear to have full terminal emulation support, so in theory you can use EMACS as a terminal multiplexer, though I somewhat doubt that it will be anywhere near as efficient as a dedicated terminal emulator (at minimum, it will use more RAM, because EMACS is huge).
1
Emacs’M-x shellemulates a dumb terminal inside an Emacs buffer, even when Emacs is running inside a terminal itself. The rest of Emacs continues executing in parallel with whatever is running inside the buffer.
– Stephen Kitt
Nov 29 at 8:25
1
@StephenKitt there's alsoM-x termandM-x ansi-termwhich offers a full terminal emulation. You can even run another emacs inside it. You can also startemacsin server mode, then runemacsclient -cto attach to it. So, while it's true that emacs lacks a decent editor, it's perfectly able to act as a terminal emulator and multiplexer and replace screen and tmux;-)
– mosvy
Nov 29 at 18:31
@mosvy so you can run Vim inside an Emacs terminal ;-).
– Stephen Kitt
Nov 29 at 18:33
Answer has been updated to include info about EMACS. As usual, they're weird and have to be the exception to almost everything...
– Austin Hemmelgarn
Nov 29 at 19:19
1
@AustinHemmelgarn a) it's not true that emacs is only implementing a dumb terminal b) it's not true that emacs is always using ptys when running external commands c) it's not true thatviand other editors are using system(3) for "command callout" functionality -- in fact, it would be impossible to implement!motion cmd,:range!cmd,:w !cmdandr !cmdinviwith system(3).viisn't even using system(3) for the simple:!cmd, because that's using the user's$SHELL, not necessarily/bin/shas used by system(3).
– mosvy
Nov 29 at 22:15
|
show 2 more comments
up vote
0
down vote
up vote
0
down vote
Barring their graphical variants, vi, and most other editors that provide shell functionality work significantly differently from a terminal multiplexer. They don't actually emulate terminals themselves, they just provide a way to run other programs on the same terminal that they are already running in.
All of this functionality is essentially implemented using the system() function provided by libc (defined by both POSIX and ANSI C, check man 3 system for more info). In short, when you call this function from a program, it suspends your current program, and then starts the requested command as a subprocess of your program. Until that command terminates, the original program completely stops execution and ignores all input. By operating this way, the new command can use the terminal you were running the original program in without needing any kind of terminal emulation.
Based on comments, EMACS, on the other hand, is a bit of an odd exception. As is typical of their development style, they apparently actually handle this completely differently, and do in fact use a PTY for normal command callout functionality, though it only emulates a 'dumb' terminal.
They also appear to have full terminal emulation support, so in theory you can use EMACS as a terminal multiplexer, though I somewhat doubt that it will be anywhere near as efficient as a dedicated terminal emulator (at minimum, it will use more RAM, because EMACS is huge).
Barring their graphical variants, vi, and most other editors that provide shell functionality work significantly differently from a terminal multiplexer. They don't actually emulate terminals themselves, they just provide a way to run other programs on the same terminal that they are already running in.
All of this functionality is essentially implemented using the system() function provided by libc (defined by both POSIX and ANSI C, check man 3 system for more info). In short, when you call this function from a program, it suspends your current program, and then starts the requested command as a subprocess of your program. Until that command terminates, the original program completely stops execution and ignores all input. By operating this way, the new command can use the terminal you were running the original program in without needing any kind of terminal emulation.
Based on comments, EMACS, on the other hand, is a bit of an odd exception. As is typical of their development style, they apparently actually handle this completely differently, and do in fact use a PTY for normal command callout functionality, though it only emulates a 'dumb' terminal.
They also appear to have full terminal emulation support, so in theory you can use EMACS as a terminal multiplexer, though I somewhat doubt that it will be anywhere near as efficient as a dedicated terminal emulator (at minimum, it will use more RAM, because EMACS is huge).
edited Nov 29 at 19:18
answered Nov 28 at 20:40
Austin Hemmelgarn
5,89411016
5,89411016
1
Emacs’M-x shellemulates a dumb terminal inside an Emacs buffer, even when Emacs is running inside a terminal itself. The rest of Emacs continues executing in parallel with whatever is running inside the buffer.
– Stephen Kitt
Nov 29 at 8:25
1
@StephenKitt there's alsoM-x termandM-x ansi-termwhich offers a full terminal emulation. You can even run another emacs inside it. You can also startemacsin server mode, then runemacsclient -cto attach to it. So, while it's true that emacs lacks a decent editor, it's perfectly able to act as a terminal emulator and multiplexer and replace screen and tmux;-)
– mosvy
Nov 29 at 18:31
@mosvy so you can run Vim inside an Emacs terminal ;-).
– Stephen Kitt
Nov 29 at 18:33
Answer has been updated to include info about EMACS. As usual, they're weird and have to be the exception to almost everything...
– Austin Hemmelgarn
Nov 29 at 19:19
1
@AustinHemmelgarn a) it's not true that emacs is only implementing a dumb terminal b) it's not true that emacs is always using ptys when running external commands c) it's not true thatviand other editors are using system(3) for "command callout" functionality -- in fact, it would be impossible to implement!motion cmd,:range!cmd,:w !cmdandr !cmdinviwith system(3).viisn't even using system(3) for the simple:!cmd, because that's using the user's$SHELL, not necessarily/bin/shas used by system(3).
– mosvy
Nov 29 at 22:15
|
show 2 more comments
1
Emacs’M-x shellemulates a dumb terminal inside an Emacs buffer, even when Emacs is running inside a terminal itself. The rest of Emacs continues executing in parallel with whatever is running inside the buffer.
– Stephen Kitt
Nov 29 at 8:25
1
@StephenKitt there's alsoM-x termandM-x ansi-termwhich offers a full terminal emulation. You can even run another emacs inside it. You can also startemacsin server mode, then runemacsclient -cto attach to it. So, while it's true that emacs lacks a decent editor, it's perfectly able to act as a terminal emulator and multiplexer and replace screen and tmux;-)
– mosvy
Nov 29 at 18:31
@mosvy so you can run Vim inside an Emacs terminal ;-).
– Stephen Kitt
Nov 29 at 18:33
Answer has been updated to include info about EMACS. As usual, they're weird and have to be the exception to almost everything...
– Austin Hemmelgarn
Nov 29 at 19:19
1
@AustinHemmelgarn a) it's not true that emacs is only implementing a dumb terminal b) it's not true that emacs is always using ptys when running external commands c) it's not true thatviand other editors are using system(3) for "command callout" functionality -- in fact, it would be impossible to implement!motion cmd,:range!cmd,:w !cmdandr !cmdinviwith system(3).viisn't even using system(3) for the simple:!cmd, because that's using the user's$SHELL, not necessarily/bin/shas used by system(3).
– mosvy
Nov 29 at 22:15
1
1
Emacs’
M-x shell emulates a dumb terminal inside an Emacs buffer, even when Emacs is running inside a terminal itself. The rest of Emacs continues executing in parallel with whatever is running inside the buffer.– Stephen Kitt
Nov 29 at 8:25
Emacs’
M-x shell emulates a dumb terminal inside an Emacs buffer, even when Emacs is running inside a terminal itself. The rest of Emacs continues executing in parallel with whatever is running inside the buffer.– Stephen Kitt
Nov 29 at 8:25
1
1
@StephenKitt there's also
M-x term and M-x ansi-term which offers a full terminal emulation. You can even run another emacs inside it. You can also start emacs in server mode, then run emacsclient -c to attach to it. So, while it's true that emacs lacks a decent editor, it's perfectly able to act as a terminal emulator and multiplexer and replace screen and tmux;-)– mosvy
Nov 29 at 18:31
@StephenKitt there's also
M-x term and M-x ansi-term which offers a full terminal emulation. You can even run another emacs inside it. You can also start emacs in server mode, then run emacsclient -c to attach to it. So, while it's true that emacs lacks a decent editor, it's perfectly able to act as a terminal emulator and multiplexer and replace screen and tmux;-)– mosvy
Nov 29 at 18:31
@mosvy so you can run Vim inside an Emacs terminal ;-).
– Stephen Kitt
Nov 29 at 18:33
@mosvy so you can run Vim inside an Emacs terminal ;-).
– Stephen Kitt
Nov 29 at 18:33
Answer has been updated to include info about EMACS. As usual, they're weird and have to be the exception to almost everything...
– Austin Hemmelgarn
Nov 29 at 19:19
Answer has been updated to include info about EMACS. As usual, they're weird and have to be the exception to almost everything...
– Austin Hemmelgarn
Nov 29 at 19:19
1
1
@AustinHemmelgarn a) it's not true that emacs is only implementing a dumb terminal b) it's not true that emacs is always using ptys when running external commands c) it's not true that
vi and other editors are using system(3) for "command callout" functionality -- in fact, it would be impossible to implement !motion cmd, :range!cmd, :w !cmd and r !cmd in vi with system(3). vi isn't even using system(3) for the simple :!cmd, because that's using the user's $SHELL, not necessarily /bin/sh as used by system(3).– mosvy
Nov 29 at 22:15
@AustinHemmelgarn a) it's not true that emacs is only implementing a dumb terminal b) it's not true that emacs is always using ptys when running external commands c) it's not true that
vi and other editors are using system(3) for "command callout" functionality -- in fact, it would be impossible to implement !motion cmd, :range!cmd, :w !cmd and r !cmd in vi with system(3). vi isn't even using system(3) for the simple :!cmd, because that's using the user's $SHELL, not necessarily /bin/sh as used by system(3).– mosvy
Nov 29 at 22:15
|
show 2 more comments
If you don't understand my post at this moment, it is completely okay. Please try your best not to close it and leave some open air.
– Tim
Nov 29 at 3:15
Please help to reopen, and/or reply in comments if you have any idea. Thanks.
– Tim
Nov 29 at 3:19
"Is X an Y?" depends on your definition of Y (and different people may have different definitions). "Is there a benefit to Z?" mostly depends on your taste - there are often several ways to achieve the same thing. How are we supposed to answer this question objectively? You can use emacs and/or screen/tmux in any way you please. The only part that has an objective answer would be if emacs uses a pty (instead of, say, a pipe) to run a shell subprocess, but that's really a detail.
– dirkt
Nov 29 at 10:33
FWIW, You can have more than one emacs session on the same machine; eg. start the server with
--daemon=foothen attach to it withemacsclient -c -s foo.– mosvy
Nov 29 at 18:48
And
emacsis of course, using pseudo-terminals to implement itsshellandtermcommands. There's no other way to do it.– mosvy
Nov 29 at 18:58