You are not logged in.

#1 2008-04-01 19:20:30

niller
Member
From: Denmark
Registered: 2008-02-12
Posts: 91

Can I prevent apps from closing in screen ??

Hi all

Is it possible to prevent mutt, emacs etc from being closed by a mistype ??

Sometimes in mutt I hit q by a mistake and it's irritating to start everything up again, because I like mutt to be on screen #2.

I wonder if it's possible to extend .screenrc with this feature (if it exist?)

My .screenrc looks like this:

screen -t Shell0  0                                                                                      
screen -t Shell1  1                                                                                      
screen -t Mutt    2 mutt                                                                                 
screen -t Emacs   3 emacs -nw                                                                            
screen -t MC      4 mc                                                                                   
screen -t Cmus    5 cmus                                                                                 
screen -t ROOT    6 su -                                                                                 
                                                                                                         
vbell off                                                                                                
                                                                                                         
startup_message off                                                                                      
                                                                                                         
#change the hardstatus settings to give an window list at the bottom of the                             \
                                                                                                         
#screen, with the time and date and with the current window highlighted                                 \
                                                                                                         
hardstatus alwayslastline                                                                               \
                                                                                                         
hardstatus string '%{= kG}[%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %D\
 %d %M %Y %{W}%c:%s %{g}]'                                                                               
#'%{= mK}%-Lw%{= KW}%50>%n%f* %t%{= mK}%+Lw%< %{= kG}%-=%D %d %M %Y %c:%s%{-}'                           
                                                                                                         
# bind F10 to Screen's quit command                                                                      
bindkey -k F2 quit

Any hints is highly appreciated.

april fool lol


/Niels
Registered Linux user #133791
Get counted at http://counter.li.org

Offline

#2 2008-04-04 00:22:24

escondida
Package Maintainer (PM)
Registered: 2008-04-03
Posts: 157

Re: Can I prevent apps from closing in screen ??

Well, you could always add...

quit=ask-yes

...to your .muttrc to have it prompt you if you hit "q." You can also configure emacs to prompt you before quitting.

it's irritating to start everything up again, because I like mutt to be on screen #2.

I hope you don't mean closing your whole screen session!

april fool

I'm choosing to assume you're not joking, in spite of this. If that means I've been had, so be it.

Offline

#3 2008-04-04 00:44:02

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: Can I prevent apps from closing in screen ??

If it's just a matter of laziness, then I'd say just create a shortcut that opens a mutt for you... so that when you close it it's two keystrokes away:
bind 'm' screen -t Mutt 2 mutt

Offline

#4 2008-04-04 07:12:28

dolby
Member
From: 1992
Registered: 2006-08-08
Posts: 1,581

Re: Can I prevent apps from closing in screen ??

ctrl+a+c creates a new screen window. fire up mutt again. no need to close the screen session or (alternatively) start all those apps when screen starts. you can create new windows and start anything you want in them


There shouldn't be any reason to learn more editor types than emacs or vi -- mg (1)
[You learn that sarcasm does not often work well in international forums.  That is why we avoid it. -- ewaller (arch linux forum moderator)

Offline

#5 2008-04-04 07:19:32

niller
Member
From: Denmark
Registered: 2008-02-12
Posts: 91

Re: Can I prevent apps from closing in screen ??

Well what I had in mind was a feature in .screenrc that prevented apps from being closed by a accident.

F.ex if I was mistyping something and screen says "Are you sure y/n ?" similar to when shutting down screen or something like that.

If it's just a matter of laziness, then I'd say just create a shortcut that opens a mutt for you... so that when you close it it's two keystrokes away:
bind 'm' screen -t Mutt 2 mutt

I guess this means CTRL+a+m ?? Hmm.. that might be the answer smile


/Niels
Registered Linux user #133791
Get counted at http://counter.li.org

Offline

Board footer

Powered by FluxBB