help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: not good proposal: "C-z <letter>" reserved for users


From: Jean Louis
Subject: Re: not good proposal: "C-z <letter>" reserved for users
Date: Tue, 16 Feb 2021 10:13:18 +0300
User-agent: Mutt/2.0 (3d08634) (2020-11-07)

* Emanuel Berg via Users list for the GNU Emacs text editor 
<help-gnu-emacs@gnu.org> [2021-02-15 21:19]:
> Robert Thorpe wrote:
> 
> > Emmanuel, I agree with Jean Louis about this. A tool that
> > can't stop and restart jobs does not provide all the
> > facilities of shell job control. Tmux and GNU Screen are not
> > full replacements for job control.
> 
> Roobert, first, what's the definition of a job? Is it
> a process or what it is, technically speaking?

Read the Job Control Basics in Bash manual.

I do not see that GNU Screen and Tmux are any replacement for job control. They
just give to user possibility to run multiple shells or other programs in the
same time so that programs do not get interrupted if user does something else. 

That is not related to job control. It does not relate to suspending a job, as
terminal multiplexers do not suspend or stop the job temporarily, they run the
processes. Inside of them one can use job control, but that is not feature of
those programs screen and tmux, it is feature of shell.

> Second, what is it you want to do with it, that cannot be done
> from the shell, but it _can_ be done with "shell job control"?
> 
> > Having a job in another tab is not the same as stopping it.
> 
> I guess not :)

That is what you can do with job control. You can stop the shell. And
regardless in which environment one is, like within screen or tmux, console,
terminal, even Emacs, one can suspend process in shell. Screen or tmux are not
about suspending a process or stopping a process.

I have asked if that exists, I do not know for tmux, but in screen there is no
such thing.

Just read the Bash manual on job control.

> kill, top, nice and renice deal with processes and they can be
> - what am I saying - they ARE - used from the shell. So just
> fire up a new pane in tmux and use them all you want, happens
> every day.

Today by emergency I have used Control-Z, but let me remember why. I think I
was searching which program could be doing some nasty staff, was it Emacs or
other program. Yesterday me and you we were playing with this and I have put
emacs as my login shell. Then I found there are multiple invokations of Emacs,
I could not believe it. Something like "emacs -c zgrep --version | head -1" was
invoked so many times, and I did not know what is happening. Emacs frames were
appearing one after the other. During that work, I was greping in Emacs sources
and trying to find a solution, so I could suspend grep in background with
Control-Z inside of shell (not inside of Emacs, as X interface was not usable
any more) and I could grep maybe other sources or do $ git log, as I was
thinking it could be possible Emacs bug or something, so I was first greping,
then thinking let me review git log. 

Processes have been spawned several every second. In 2-3 seconds I would get 40
emacs processes. X became unusable, I had to switch to console. It looked like
denial of service attack. All what it did is that some program, some process
tried to invoke the login shell and my login shell was "emacs" and login shell
wanted to get version number of zgrep. Instead of shell, emacs was spawned that
does not have option "-c".

When system is under load there is no time to spawn tmux or screen. It is
emergency, I went to console, there is panic level, I was greping and awking
processes and killing bunch of them which have "zgrep" and "emacs" in command
line in order to be able to find some references what is doing it.

kill, top, nice, etc, they are all good and fine especially when you have time
and you need not urgently stop a process.

When process is already running in the shell, you have Control-Z.

Imagine you log by SSH into remote server and you start maintaining a database,
process may take a lot of resources and you do not know what is happening. User
cannot predict that something like that is to happen to first invoke screen or
tmux to be able to switch easier from one terminal to other.

In your considerations you also assume that every user has installation rights,
but that is not so, there are much more shell users who do not have
installation rights. To have screen/tmux they would need to ask their
administrator to install it, but Control-Z works instantly. 

Just because you as user use Emacs personally and individually without other
users on your computer, does not mean that Emacs is for single user computers.
Neither Emacs nor other GNU/Linux and UNIX-like software. It is meant for multi
user computers. My family use multi user computers. Each family member have
their user space. They can use software that is installed, but cannot install
themselves, at least not globally. Local installations are possible, but is
difficult.

Universities and various institutions do not give root rights to every user.
They may not have screen/tmux. 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]