screen-devel
[Top][All Lists]
Advanced

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

Re: [screen-devel] alias support for GNU Screen


From: Sadrul Habib Chowdhury
Subject: Re: [screen-devel] alias support for GNU Screen
Date: Wed, 22 Oct 2008 08:20:52 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

* Steve Kemp had this to say on [22 Oct 2008, 10:35:11 +0100]:
> On Tue Oct 21, 2008 at 21:06:13 -0400, Sadrul Habib Chowdhury wrote:
> 
> > Hi. I tried your patch tonight, and have made some changes. The patchset
> > is here: http://www.pidgin.im/~sadrul/pp/screen-alias/. 0001 is your
> > patch (after some whitespace changes), 0002 fixes a crash from
> > unaliasing, and 0003 changes some of how the aliasing works.
> 
>   Thanks.
> 
>   (I've already changed the deletion to avoid that crash. :)
> 
> > >     bind x alias_name
> > > 
> > >   Unfortunately that eventually causes problems, because SaveAction
> > >  keeps pointers to my linked-list which get juggled around when aliases
> > >  are added or removed.
> 
> > With 0003, both creating binding for aliases, and setting aliases for
> > aliases are possible.
> 
>   Indeed it mostly works, but there is still a problem.  Try this:
> 
>     alias foo echo 'testing'
>     bind p foo
>     alias foo
> 
>   Now you're in the same situation that I was, you've got an alias
>  that doesn't exist bound to a key.  Press <ctrl-a p> and screen
>  will crash.

Yes it does. Thankfully, it was because of a small typo, and now it's
fixed! Thanks!
(http://www.pidgin.im/~sadrul/pp/screen-alias/0004-Tyop.-Fixes-a-crash-after-unaliasing-a-bind.patch)

Instead of having SaveAction keep a pointer in the linked list, what I
did was assign an action number to the aliased commands (starting from
RC_LAST + 1), and track the command numbers (ie., do the same as thing
as before). This won't work in a situation like this:

        alias foo command
        bind f foo
        alias foo
        alias foo somecommand <-- ('somecommand' could be 'command')

But such a situation is probably more contrived than realistic.

>   Also I notice a minor functionality change.  With this:
> 
>     alias bar echo
> 
>   My version:
>     <Ctrl+a :> bar 'test'
>         -> test
> 
>   Your version:
>     <ctrl+a :> bar 'test'
>         -> : echo: one or two arguments required
> 

Indeed. I'll try to look at this, possibly during this weekend. Thanks
for trying out the changes.

Cheers,
Sadrul




reply via email to

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