17

Is it possible to use the fish shell with cygwin? I wasn't able to compile the source in cygwin, and I didn't find any precompiled packages. Is there a good reason for not having fish in cygwin?

3 Answers 3

23

fish shell 2.1.0 is now officially supported in Cygwin, it's possible to install it using the default installer.

15

Here's how I managed to compile fish in Cygwin.

Step 1: Check that all dependencies are installed

First, make sure we have the following cygwin packages:

  • libncurses-devel
  • libiconv
  • autoconf (not a really a dependency of fish, but we need it for a later step)

Step 2: Download and extract the latest source

Next, download the latest source from http://fishshell.com (I used fish-1.23.1.tar.gz). Extract the source to your directory of choice and cd to it:

$ tar zxvf fish-1.23.1.tar.gz -C /usr/local/src/
$ cd /usr/local/src/fish-1.23.1/

Step 3: Edit configure.ac to remove checks for iconv

Now for some reason, ./configure cannot detect libiconv properly. To get around the problem we remove the check for it (we'll specify the lib manually later). To do so, we edit configure.ac and remove checks for iconv_open. Searching for iconv_open reveals 3 occurences; we comment them all out. So, from:

AC_SEARCH_LIBS( iconv_open, iconv, ....)

We change to:

#AC_SEARCH_LIBS( iconv_open, iconv, ....)

Step 4: Rebuild and run ./configure

Next, we rebuild the ./configure script by running autoconf then run the configure script:

$ autoconf && ./configure

Step 5: Edit Makefile to include correct path to curses.h

Another problem I faced was with curses.h -- gcc couldn't find it. A quick search revealed that it's in /usr/include/ncurses.

The Makefile has a hardcoded include path for it in CFLAGS, but it points to /usr/local/include/ncurses instead.

So, we edit Makefile and change:

CFLAGS = -I/usr/local/include/ncurses -std=c99 ....

to

CFLAGS = -I/usr/include/ncurses -std=c99 ...

Step 6: Export LDFLAGS to link in libiconv, and we're ready to compile/install.

Finally, we export the necessary LDFLAGS to link in iconv, then compile and install!

$ export LDFLAGS="-liconv"
$ make && make install

Enjoy fish

$ fish
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
me@home /u/l/s/fish-1.23.1> 
5
  • +1 I can confirm the steps above should work. I also added #define HAVE_NCURSES_H 1 in the generated header file config.h (for the same reasons stated above)
    – Amro
    Aug 26, 2011 at 21:35
  • I've installed libiconv and set LDFLAGS, but I still get an error: set_color.c:16:20: curses.h: No such file or directory set_color.c: In function translate_color': set_color.c:116: warning: implicit declaration of function strcasecmp' set_color.c: In function main': set_color.c:333: error: ERR' undeclared (first use in this function)
    – muriloq
    Aug 29, 2011 at 22:12
  • I saw that error initially too. Have you installed libncurses-devel and changed the changed the -I path in the `Makefile (step 5)?
    – Shawn Chin
    Aug 30, 2011 at 0:21
  • Yes, I even reinstalled libncurses-devel again, just to be sure. Perhaps there's another dependency that was already present in your system? Looking for the error message I've found the following bug report: sourceforge.net/tracker/…
    – muriloq
    Sep 2, 2011 at 12:43
  • @muriloq Sounds like curses.h is not being included (ERR is defined there). Can you have a peek at /usr/include/ncurses/ and see if it's there?
    – Shawn Chin
    Sep 2, 2011 at 13:52
0

Check fish issues #680 and #319 at GitHub, there is everything You need to compile fish on cygwin.

1
  • 2
    Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline.
    – Ashildr
    Oct 14, 2013 at 16:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .