From 07cdba7826ee15d51d2ec26d5492d0ee6b9b56f5 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Mon, 8 Nov 2010 18:12:39 -0600 Subject: [PATCH] usr/bin/byobu-config: add directory option when creating new window, LP: #623033 --- debian/changelog | 5 +++++ usr/bin/byobu-config | 21 +++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4f86ceef..e3f5c6a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ byobu (3.7) unreleased; urgency=low + [ Dustin Kirkland ] * usr/lib/byobu/ec2_cost, usr/share/byobu/ec2/rates.eu_ie, usr/share/byobu/ec2/rates.us_ca, usr/share/byobu/ec2/rates.us_va: - add ec2_cost support for t1.micro instances, LP: #669190 @@ -55,6 +56,10 @@ byobu (3.7) unreleased; urgency=low * usr/lib/byobu/services: - drop max instance count from NC service reporting; was inaccurate + [ Marcus Asshauer ] + * usr/bin/byobu-config: add directory option when creating new window, + LP: #623033 + -- Dustin Kirkland Thu, 21 Oct 2010 12:09:14 -0500 byobu (3.6-0ubuntu1) natty; urgency=low diff --git a/usr/bin/byobu-config b/usr/bin/byobu-config index b0eb1f9a..96cadb9f 100755 --- a/usr/bin/byobu-config +++ b/usr/bin/byobu-config @@ -204,6 +204,8 @@ def newwindow(screen, size): titlel=Label(_("Title: ")) command=Entry(20, text="/bin/sh", returnExit=1) commandl=Label(_("Command: ")) + path=Entry(20, text="~", returnExit=1) + pathl=Label(_("Path: ")) rl=Label(_("Presets: ")) if len(cmd) > 10: @@ -223,15 +225,17 @@ def newwindow(screen, size): bb = ButtonBar(screen, ((_("Apply"), "apply"), (_("Cancel"), "cancel", ESC)), compact = 1) - g = GridForm(screen, _("Create new window(s):"), 2, 5 ) + g = GridForm(screen, _("Create new window(s):"), 2, 6 ) g.add(titlel, 0, 0, anchorLeft=1,padding=(4,1,0,1)) g.add(title, 1, 0, anchorLeft=1) g.add(commandl, 0, 1, anchorLeft=1, anchorTop=1,padding=(4,0,0,1)) g.add(command, 1, 1, anchorLeft=1) - g.add(rl, 0, 2, anchorLeft=1,padding=(4,0,0,1)) - g.add(r, 1, 2) - g.add(cb, 1, 3, padding=(4,1,0,1)) - g.add(bb, 1, 4, padding=(4,1,0,0)) + g.add(pathl, 0, 2, anchorLeft=1, anchorTop=1,padding=(4,0,0,1)) + g.add(path, 1, 2, anchorLeft=1) + g.add(rl, 0, 3, anchorLeft=1,padding=(4,0,0,1)) + g.add(r, 1, 3) + g.add(cb, 1, 4, padding=(4,1,0,1)) + g.add(bb, 1, 5, padding=(4,1,0,0)) if bb.buttonPressed(g.runOnce()) != "cancel": sel=r.getSelection() @@ -242,9 +246,14 @@ def newwindow(screen, size): if cb.value(): appendwindow(win) else: - win='screen -t %s %s' % (title.value(), command.value()) + cpath='screen -X setenv newpath %s' % (path.value()) + win='screen -X eval \'chdir $newpath\' \"screen -t %s %s\"' % (title.value(), command.value()) + commands.getoutput(cpath) commands.getoutput(win) if cb.value(): + cpath='chdir %s' % (path.value()) + win='screen -t %s %s' % (title.value(), command.value()) + appendwindow(cpath) appendwindow(win) return 100