support for fish shell in the installer

Bug #1002137 reported by Rickard Andersson on 2012-05-21
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
byobu
Wishlist
Unassigned

Bug Description

Hi

I've been running byobu in Debian with the fish shell for some time (http://fishshell.com/). However my attempts to make byobu auto-launch hasn't been completely successful. I can make byobu start by editing the fish config file in ~/.config/fish/config.fish but I've never been able to use scp to transfer files to servers using this configuration.

My current configuration looks like this:

function start_byobu
  if [ -z "$BYOBU_WINDOWS" ]
    exec byobu-launcher
  end
end

start_byobu

I guess some more research is needed before this could be adopted into the install script, but I'd like to request this change for future versions of byobu.

Thanks

Dario Bertini (berdario) wrote :

I use this in my config.fish:

if [ -z "$DISPLAY" -a -z "$BYOBU_WINDOWS" ] ;
   if $TERM != "dumb";
     exec byobu-launcher;
   end
end

(I don't know how to mix these 2 kind of conditionals together, so I just nested them)

-z "$DISPLAY", is to avoid launching byobu when in a terminal emulator:

fish doesn't have a different rc, and profile... and gnome-terminal, konsole and such don't execute the profile...
thus, the expected behaviour for byobu is to be launched only when using one of the tty (or ssh, or similar things)... this makes sense since (inside gnome) we already have tab management and misc info about our system available (maybe I could've used $TERM != "xterm")

 if $TERM != "dumb"; instead is one of the check already done inside byobu-launcher, but apparently, exec'ing it directly from fish like this causes problem in dumb session (like sftp)... again, probably this is due to the absence of any distinction between profiles and rc

Rickard Andersson (rickard-j) wrote :

It seems to be working better than my example, however I had to enclose the second if statement in square brackets:

if [ -z "$DISPLAY" -a -z "$BYOBU_WINDOWS" ] ;
   if [ $TERM != "dumb" ];
     exec byobu-launcher;
   end
end

Logging in using ssh works and transferring a file using scp also works.

Dustin Kirkland  (kirkland) wrote :

Hi there, thanks for the feature request.

I'm not familiar with fish... What would you like me to do as upstream maintainer of byobu? You're suggesting that I ship this script within Byobu, and optionally install this somewhere in the user's fish configuration when the user wants to launch by default?

Changed in byobu:
importance: Undecided → Wishlist
status: New → Confirmed
status: Confirmed → Incomplete
Dustin Kirkland  (kirkland) wrote :

This seems to be working for me in ~/.config/fish/config.fish

[ -n "$DISPLAY" -a -z "$BYOBU_WINDOWS" ] ; and [ "$TERM" != "dumb" ] ; and exec byobu-launcher

Changed in byobu:
status: Incomplete → Fix Committed
Changed in byobu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers