Re: [Fish-users] Where are the colors stored?

2023-02-22 Thread Kurtis Rader
I haven't used Fish in several years (I'm now using Elvish) but the color
theme vars used to be stored as "universal" variables which can be found in
~/.config/fish/fish_variables. This is from my Fish uvar file that I still
have on my system:

# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR __fish_initialized:3400
SETUVAR fish_color_autosuggestion:555\x1ebrblack
SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:blue
SETUVAR fish_color_comment:red
SETUVAR fish_color_cwd:green
SETUVAR fish_color_cwd_root:red
SETUVAR fish_color_end:green
SETUVAR fish_color_error:brred
SETUVAR fish_color_escape:brcyan
SETUVAR fish_color_history_current:\x2d\x2dbold
SETUVAR fish_color_host:normal
SETUVAR fish_color_host_remote:yellow
SETUVAR fish_color_normal:normal
SETUVAR fish_color_operator:brcyan
SETUVAR fish_color_param:cyan
SETUVAR fish_color_quote:yellow
SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold
SETUVAR fish_color_search_match:\x2d\x2dbackground\x3d111
SETUVAR
fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_status:red
SETUVAR fish_color_user:brgreen
SETUVAR fish_color_valid_path:\x2d\x2dunderline
SETUVAR fish_key_bindings:fish_default_key_bindings
SETUVAR fish_pager_color_completion:normal
SETUVAR fish_pager_color_description:B3A06D\x1eyellow\x1e\x2di
SETUVAR fish_pager_color_prefix:cyan\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_pager_color_selected_background:\x2dr

On Wed, Feb 22, 2023 at 6:16 PM Luciano ES  wrote:

> I have fish 2 in one machine and fish 3 in a new installation.
> I want to import the exact same color scheme from the old one
> to the new one.
>
> I can't rely on theme names (in case those exist), I'm pretty
> sure my old "theme" is customized.
>
> Where does fish store that information so I can import it?
>
> --
> Luciano ES
> >>
>
>
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Yet another * issue

2020-08-31 Thread Kurtis Rader
On Mon, Aug 31, 2020 at 11:13 AM John Chludzinski <
john.chludzin...@gmail.com> wrote:

> Whereas, I’ve haven’t had time to try again to duplicate the ‘rm’ problem,
> I have encountered yet another * “issue”:
>
> I tried:
>
> ls
> ./a10_soc_devkit_ghrd/software/bootloader/u-boot-socfpga/arch/arm/dts/'*10*'
>

That won't work because quoting the wildcard causes the shell to treat it
like any other character; i.e., it loses its meaning as a wildcard. And the
ls command does not do wildcard expansion.


> ls './a10_soc_devkit_ghrd/software/bootloader/u-boot-
> socfpga/arch/arm/dts/*10*'
>

See http://fishshell.com/docs/current/index.html#wildcards. Specifically
this paragraph:

Note that for most commands, if any wildcard fails to expand, the command
> is not executed, $status
> <http://fishshell.com/docs/current/index.html#variables-status> is set to
> nonzero, and a warning is printed. This behavior is consistent with setting
> shopt -s failglob in bash. There are exactly 4 exceptions, namely set
> <http://fishshell.com/docs/current/cmds/set.html#cmd-set>, overriding
> variables in overrides
> <http://fishshell.com/docs/current/index.html#variables-override>, count
> <http://fishshell.com/docs/current/cmds/count.html#cmd-count> and for
> <http://fishshell.com/docs/current/cmds/for.html#cmd-for>. Their globs
> are permitted to expand to zero arguments, as with shopt -s nullglob in
> bash.



-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Yet another * issue

2020-08-31 Thread Kurtis Rader
On Mon, Aug 31, 2020 at 12:08 PM John Chludzinski <
john.chludzin...@gmail.com> wrote:

> Well, how should I accomplish what I’ve been trying to do with ‘*’ ?
>

If the wildcard might expand to nothing the usual solution is to use the
`set` command:

set files
./a10_soc_devkit_ghrd/software/bootloader/u-boot-socfpga/arch/arm/dts/*10*


Then test if $files is not empty:

if set -q files[1]
ls $files
end


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] || and propagate error

2019-09-07 Thread Kurtis Rader
On Sat, Sep 7, 2019 at 9:08 AM Marcin Zajączkowski  wrote:

> Sure. I want to be able to call other command on the command failure:
>
> > my_command || call_error_handler
>
> where the error handler could be curl to https://healthchecks.io/


The following script produces this result:









*returning status 0status is 0returning status 1handling status 1status is
1returning status 33handling status 33status is 33*


function my_command
echo returning status $argv[1]
return $argv[1]
end

function call_error_handler
set -l saved_status $status
echo handling status $saved_status
return $saved_status
end

my_command 0; or call_error_handler
echo status is $status
my_command 1; or call_error_handler
echo status is $status
my_command 33; or call_error_handler
echo status is $status
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Help me get rid of the blue

2019-05-09 Thread Kurtis Rader
On Wed, May 8, 2019 at 7:14 AM Luciano ES  wrote:

> > > Where does fish store those color choices? I want to restore them
> > > from a backup.
>

Assuming your backup includes your home directory your fish color
preferences will be backed up.


> I have 2.7.1 but please tell me about it in all versions so I can
> always find it if I upgrade it.
>
> Those vars have to survive reboots. They have to be stored somewhere.
>

As I said in my earlier reply they are stored in your $HOME/.config/fish
directory. In the fish 2.7 release the file name is `fishd.` plus your
system host name or primary mac address. But you don't need to know that.
Do not edit that file by hand. Always use the fish `set -U` command to
modify it. In fish 3.x the file no longer has a unique machine specific
suffix. Which is nice because it means that if you copy your home directory
to a different system you will automatically get your fish color
preferences on that machine.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Help me get rid of the blue

2019-05-07 Thread Kurtis Rader
On Tue, May 7, 2019 at 2:03 PM Luciano ES  wrote:

> My terminal is a mess now.
>
> Where does fish store those color choices? I want to restore them
> from a backup.
>

By default they are universal vars and thus stored in a file whose name
depends on which version of fish you are running. Something you neglected
to mention. But the file is in ~/.config/fish.

When experimenting you can "shadow" those uvars by creating global
instances. For example:

set -g fish_color_autosuggestion red green

Then when you're happy with the results update the uvar:

set -U fish_color autosuggestion red green

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Help me get rid of the blue

2019-05-07 Thread Kurtis Rader
On Tue, May 7, 2019 at 1:21 PM Luciano ES  wrote:

> I use fish_config to customize my colors and I have a problem with
> that: something that absolutely insists on being blue.
>

The `fish_config` utility is cool but I stopped using it after the first
week. It's easier to just tweak things from the CLI. Note that colors are
simply stored as a set of universal vars; e.g.,
`fish_color_autosuggestion`. You can see them by typing `set -U`.


> First off, when I am typing and fish suggests something, I get a
> color that I don't like. I try to change it with fish_config,
> but the resulting color on the terminal is never the same displayed
> on the fish_config color selector. So I have to try many, many colors
> until I find one that translates to something I'm willing to accept.
>

That's a fairly typical experience. Even if one of the demo background
colors is a close match for your terminal's background color the vagaries
of color handling mean that what you see in the browser is unlikely to
exactly match what you see in your terminal. In particular you may need to
add `set fish_term24bit 1` to your ~/.config/fish/config.fish to force fish
to use 24-bit colors rather than downgrading them to the 256 or 16 color
palettes.

Then I accept fish's suuggestion for autocompletion and the
> autocompleted path is always dark blue, which is terrible on my
> pitch black background. It doesn't matter what I choose in the color
> picker, the result is always dark blue, without fail.
>

Note that there is a difference between command autosuggestions (which uses
`fish_color_autosuggestion` for the suggested but not accepted portion of
the command) and command parameters that have already been accepted (which
uses `fish_color_param`).

See http://fishshell.com/docs/current/index.html#variables-color

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Completion problem with regexp and string concatenation

2019-03-06 Thread Kurtis Rader
On Wed, Mar 6, 2019 at 1:29 PM SanskritFritz 
wrote:

> Hi and thanks for your answer.
> Indeed this way it works, but I don't understand why, because when I
> test that expression this works:
> string match --regex ' diff .*::[^ ]+ 'aaa'$' "borg diff ::aaa aaa"
> and this doesn't because (commandline) can contain spaces:
> string match --regex ' diff .*::[^ ]+ 'aaa'$' borg diff ::aaa aaa
>

You seem to be under the misapprehension that fish behaves like POSIX
shells (e.g., bash) with respect to command substitution. That is, that the
output of `(commandline)` is split on whitespace. The POSIX equivalent,
`$(commandline)` does split on whitespace. But fish only splits (i.e.,
tokenizes) on newlines. So in fish, assuming the command line has a single
line, the output of `(commandline)` is equivalent to the double-quoted
string in your first example. There are various experiments you can do to
show this. For example:

set var (commandline)
set --show var

Note that this is also true for var expansion. Try this:

set var "borg diff ::aaa aaa"
string match --regex ' diff .*::[^ ]+ 'aaa'$' $var

 Notice that `$var` doesn't need to be enclosed in double-quotes. Unlike a
POSIX shell where you do need to quote the var expansion to keep it from
being split on $IFS.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Problem using ~ in path

2018-09-26 Thread Kurtis Rader
On Wed, Sep 26, 2018 at 1:43 PM John Chludzinski 
wrote:

> I tried to use ~ in a path and got this:
>
> sudo dd if=~/Downloads/SSS/sss_image-20180817.img of=/dev/sdb bs=1048576
>
> dd: failed to open '~/Downloads/SSS/sss_image-20180817.img': No such
> file or directory
>

That is the expected behavior. From the documentation:

Home directory expansion
> The ~ (tilde) character at the beginning of a parameter, followed by a
> username, is expanded into the home directory of the specified user. A lone
> ~, or a ~followed by a slash, is expanded into the home directory of the
> process owner.


This is also how it works in shells like ksh and bash. The shell has no way
of knowing that the string following "if=" is a path. You can use a var to
do it:

set x ~/Downloads/...
sudo dd if=$x ...

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Problem expanding file names

2018-07-31 Thread Kurtis Rader
On Tue, Jul 31, 2018 at 11:57 AM, John Chludzinski <
john.chludzin...@gmail.com> wrote:

> I was in my fish shell (2.7.1) and tried to expand a file name:
>
> $ rpm -qf /usr/lib64/libnc
>
> I double tabbed at this point and fully expecting to see:
>
> ...lib64/libncurses.so.5
>
> as an option.
>

It's because the rpm completions inhibit pathname completion in that
scenario (assuming I'm reading the completion script correctly). Most
likely just an oversight by the people of have worked on that command
completion. Open an issue asking that your use case be handled:
https://github.com/fish-shell/fish-shell/issues/new. Even better would be
if you opened a pull-request with a fix.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] "here document" for FISH ?

2018-06-05 Thread Kurtis Rader
On Tue, Jun 5, 2018 at 3:05 PM, John Chludzinski  wrote:

> Is this in the offing? On the plate? Coming soon to a theater near you?
>

Pretty unlikely as it has been discussed before and rejected. Most of the
time where it is used a simple multiline string would work just as well.
But if you think you can make a convincing argument for implementing the
feature you should open an issue:
https://github.com/fish-shell/fish-shell/issues/new

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] "set -x" problem?

2018-05-11 Thread Kurtis Rader
It is working correctly. You're naturally confused because fish special
cases PATH, MANPATH, and CDPATH. It automatically splits on colons when
importing those vars from the environment and joins the elements with
colons when exporting to an external command. It does not do that for any
other environment var. Not even those that have "PATH" in the name. This is
(sort of) documented:

fish automatically creates arrays from the variables PATH, CDPATH and
> MANPATH when it is started. (Previous versions created arrays from *all* 
> colon-delimited
> environment variables.)


See https://github.com/fish-shell/fish-shell/issues/436 for a proposal on
how to improve this via "tied variables". I was working the code for that
feature which would have made it into the fish 3.0 release. Sadly I stopped
working on fish when I decided I could no longer work with one of the other
devs so I didn't complete that work. And it doesn't look like any of the
remaining devs consider it important enough to include in the 3.0 release.


On Fri, May 11, 2018 at 12:53 PM, John Chludzinski <
john.chludzin...@gmail.com> wrote:

> I'm trying to set an env. var.:
>
> set -x LD_LIBRARY_PATH /usr/lib64 /lib64 /lib /usr/lib
> /mnt/ssd/OpenDDS/lib/ /mnt/ssd/OpenDDS/ACE_wrappers/lib/
>
> Then I run the Perl script:
>
> $ perl ./run_test.pl
> /mnt/ssd/OpenDDS/bin/DCPSInfoRepo -ORBDebugLevel 10 -ORBLogFile
> DCPSInfoRepo.log -o repo.ior
> /mnt/ssd/OpenDDS/bin/DCPSInfoRepo: error while loading shared libraries:
> libOpenDDS_InfoRepoServ.so.3.12.0: cannot open shared object file: No
> such file or directory
>
> I go into BASH:
>
> export LD_LIBRARY_PATH=/usr/lib64:/lib64:/lib:/usr/lib:/mnt/ssd/
> OpenDDS/lib/:/mnt/ssd/OpenDDS/ACE_wrappers/lib/
>
> Then the Perl script:
>
> $ perl ./run_test.pl
> /mnt/ssd/OpenDDS/bin/DCPSInfoRepo -ORBDebugLevel 10 -ORBLogFile
> DCPSInfoRepo.log -o repo.ior
> TAO (10880|140123965663040) - Completed initializing the process-wide
> service context
> TAO (10880|140123965663040) - Default ORB services initialization begins
> TAO (10880|140123965663040) - 
> ORBInitializer_Registry::register_orb_initializer
> 0 @0x219dea0
> TAO (10880|140123965663040) - 
> ORBInitializer_Registry::register_orb_initializer
> 1 @0x219de20
> TAO (10880|140123965663040) - Default ORB services initialization completed
> TAO (10880|140123965663040) - We are the default ORB ...
>
> Question: Why isn't the FISH 'set -x' command functioning as advertised?
>
> BTW> fish --version
> fish, version 2.6.0
>
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
>


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] "set -x" problem?

2018-05-11 Thread Kurtis Rader
On Fri, May 11, 2018 at 1:16 PM, John Chludzinski <
john.chludzin...@gmail.com> wrote:

> Is this changing in 3.0?
>

Probably not. As I indicated in my previous reply I had hoped to resolve
issue #436 in time for the 3.0 release but didn't complete the work before
I stopped contributing to fish. And it doesn't look like any of the other
devs feel it is important enough to include.


On Fri, May 11, 2018 at 4:06 PM, Kurtis Rader <kra...@skepticism.us> wrote:
>>>
>>>> It is working correctly. You're naturally confused because fish special
>>>> cases PATH, MANPATH, and CDPATH. It automatically splits on colons when
>>>> importing those vars from the environment and joins the elements with
>>>> colons when exporting to an external command. It does not do that for any
>>>> other environment var. Not even those that have "PATH" in the name. This is
>>>> (sort of) documented:
>>>>
>>>> fish automatically creates arrays from the variables PATH, CDPATH and
>>>>> MANPATH when it is started. (Previous versions created arrays from
>>>>> *all* colon-delimited environment variables.)
>>>>
>>>>
>>>> See https://github.com/fish-shell/fish-shell/issues/436 for a proposal
>>>> on how to improve this via "tied variables". I was working the code for
>>>> that feature which would have made it into the fish 3.0 release. Sadly I
>>>> stopped working on fish when I decided I could no longer work with one of
>>>> the other devs so I didn't complete that work. And it doesn't look like any
>>>> of the remaining devs consider it important enough to include in the 3.0
>>>> release.
>>>>
>>>

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Chrome crashing scews up FISH

2018-02-27 Thread Kurtis Rader
On Tue, Feb 27, 2018 at 2:22 PM, John Chludzinski <
john.chludzin...@gmail.com> wrote:

> First, I'm currently using Fedora 27.
>
> Second, whenever Chrome crashing on me, which happens a lot lately, and I
> execute 'ls' in my FISH shell, I get:
>
> ls: cannot open directory '.' : Input/output error
>
> Any ideas as to why this happens (to FISH)?
>

It's not happening to or because of fish. Something external to fish is
causing the CWD to become invalid. The most likely explanation is the CWD
is on a non-local filesystem like NFS and the remote system is no longer
responding or is reporting that the filesystem is no longer available.
Another possibility is it is on a local filesystem that is no longer usable
due to a disk fault or something similar (which might be why Chrome is
crashing). Check the output of `df` to see if any mountpoints are missing
and the contents of /var/log/syslog (or whatever the name of the system log
is on Fedora 27) for error messages.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Just did a 'dnf update' for Fedora 25 and now get this for any command

2017-12-11 Thread Kurtis Rader
You need to restart all your interactive shells. Your old shell processes
don't know about the new `argparse` builtin. Just doing `exec fish` should
be sufficient.

On Mon, Dec 11, 2017 at 6:59 AM, John Chludzinski <
john.chludzin...@gmail.com> wrote:

> $ fish --version
>
> fish, version 2.6.0
> fish: argparse: command not found...
> /usr/share/fish/functions/prompt_pwd.fish (line 2):
> argparse -n prompt_pwd --max-args=0 $options -- $argv
> ^
> in function “prompt_pwd”
> called on line 6 of file /usr/share/fish/functions/fish_prompt.fish
>
> in command substitution
> called on line 4 of file /usr/share/fish/functions/fish_prompt.fish
>
> in function “fish_prompt”
> called on standard input
>
> in command substitution
> called on standard input
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
>


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] dirh numbers

2017-10-20 Thread Kurtis Rader
On Fri, Oct 20, 2017 at 10:36 AM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> dirh outputs a list of up the 25 of the past directories I've been in.
> Entries in the list are numbered.
> Is there a way to ask to cd to the directory of an entry by its number?
>

The `cdh` command presents the same info (with duplicates removed) and lets
you select one by number or letter.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] shortening long switch names

2017-10-10 Thread Kurtis Rader
On Tue, Oct 10, 2017 at 3:17 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> I noticed that I can shorten the long switch --argument-names for a
> function as much as I want and it still works. I can use --argument or
> --arg or even --a. Of course I can also use the short form -a. Is this a
> general feature of fish or do only some commands support using abbreviated
> versions of long switch names as long as only one switch matches it?
>

It's a standard feature of GNU getopt_long(). From its man page:

   The getopt_long() function works like getopt() except that it also
> accepts  long  options,
>started with two dashes.  (If the program accepts only long
> options, then optstring should
>be specified as an empty string (""), not NULL.)  Long option names
> may be abbreviated  if
>the  abbreviation  is  unique or is an exact match for some defined
> option.  A long option
>may take a parameter, of the form --arg=param or --arg param.


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] running functions in background

2017-09-24 Thread Kurtis Rader
Also, if the function does not modify the state of the current shell, and
you want to be able to run it in the background, there is a simple
solution. Simply create a shell script that runs the function.

On Sun, Sep 24, 2017 at 4:44 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> I see that can enter a command name (referring to an executable script
> file in PATH) followed by & to run it in the background, but the same
> doesn't seem to work with function names. Is there a reason why those are
> treated differently?
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
>


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] running functions in background

2017-09-24 Thread Kurtis Rader
On Sun, Sep 24, 2017 at 4:44 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> I see that can enter a command name (referring to an executable script
> file in PATH) followed by & to run it in the background, but the same
> doesn't seem to work with function names. Is there a reason why those are
> treated differently?
>

Mostly because doing so is ill-defined and can result in unexpected
results. If the function modifies the state of the shell running it in the
background (i.e., like an external command) would mean it cannot do so.
Create the following function in bash (or zsh, etc.). Then type `x=abc; x;
echo $x`. Then type `x=abc`, `x&`, then `echo $x`. Notice the difference?

x() {
x=def
}

The only way to do this sensibly is to simulate running it in the
background by running it in a separate thread. There's an open issue
discussing this. Someone just needs to write the code to implement the idea
:-)

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] set_color --dim

2017-09-22 Thread Kurtis Rader
On Fri, Sep 22, 2017 at 1:10 PM, Kurtis Rader <kra...@skepticism.us> wrote:

> On Thu, Sep 21, 2017 at 6:20 AM, Mark Volkmann <r.mark.volkm...@gmail.com>
> wrote:
>
>> Is it possible to get "set_color --dim" to work on macOS?
>> It was quite a battle to get --italic to work, but I'm past that.
>> I just want to verify that it is possible to get --dim working before I
>> expend any more effort.
>>
>
> Your terminal and its terminfo definition have to support it. If you run
>
> infocmp -1L | grep enter_dim_mode
>
> and get no output then your terminfo doesn't support it and therefore fish
> can't either. Note that xterm doesn't support dim mode so the usual xterm
> terminfo definitions don't either. Both Terminal.app and iTerm2 support dim
> mode but if you're using a xterm terminfo definition (e.g.,
> "xterm-256color") then fish doesn't know the terminal supports it. You'll
> need to create a custom terminfo definition that includes
> "enter_dim_mode=\E[2m".
>

Correction, the terminfo entry should be "dim=\E[2m,". The string
"enter_dim_mode" is what a program like fish uses to retrieve the dim
capability string.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] set_color --dim

2017-09-22 Thread Kurtis Rader
On Thu, Sep 21, 2017 at 6:20 AM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> Is it possible to get "set_color --dim" to work on macOS?
> It was quite a battle to get --italic to work, but I'm past that.
> I just want to verify that it is possible to get --dim working before I
> expend any more effort.
>

Your terminal and its terminfo definition have to support it. If you run

infocmp -1L | grep enter_dim_mode

and get no output then your terminfo doesn't support it and therefore fish
can't either. Note that xterm doesn't support dim mode so the usual xterm
terminfo definitions don't either. Both Terminal.app and iTerm2 support dim
mode but if you're using a xterm terminfo definition (e.g.,
"xterm-256color") then fish doesn't know the terminal supports it. You'll
need to create a custom terminfo definition that includes
"enter_dim_mode=\E[2m".

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] commands that do not set status

2017-09-17 Thread Kurtis Rader
On Sun, Sep 17, 2017 at 6:24 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> Is there a short list of fish commands that do not set the status variable?
>

I can't think of any that aren't syntactical keywords like `end`. There are
a handful which propagate the status of a command they preface (e.g.,
"builtin"). You should assume that every command sets $status.

Note that "and" and "or" are both commands that set $status and which are
also syntactical keywords. The exit status of the command that they preface
is propagated to $status. This means you cannot chain them like this:

command_A
and command_B
or command_C

That's because if "command_B" returns a non-zero status then "command_C"
will be run.

The "set" command is special in that it deliberately propagates the status
of any command substitution as its status. But will also set $status if
invoked with invalid arguments.

Others aren't technically commands just syntactical keywords: "and", "or",
"builtin", "command", "begin", "case", "end", "else", "if", "for",
"switch", "while", "continue", "break". The status of the commands that
follow them is visible for the keywords which take a command (e.g.,
"builtin"). However, even here there are exceptions such as for "if" and
"while". Those, like "continue", which are not followed by a command
obviously do not affect $status.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Fish shell on Android

2017-09-14 Thread Kurtis Rader
On Thu, Sep 14, 2017 at 11:08 AM, Luis Manuel Sánchez <
luissanchez...@gmail.com> wrote:
>
> I use the ADB shell to access the Android OS, I would like to have the
> fish shell benefits when in Android. Is there a port of fish shell to run
> on Android?
>

I have no idea where to find it but one exists since we've had a few issues
opened about using fish inside termux on Android. Such as this one:
https://github.com/fish-shell/fish-shell/issues/4269

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] fish_history problem

2017-09-12 Thread Kurtis Rader
On Tue, Sep 12, 2017 at 6:54 AM, Peter Flood <i...@whywouldwe.com> wrote:

> Is `~/.config/fish/fish_history` still the place where command history is
> stored in v2.6? I ask because I use fish every day yet that file has a
> modified timestamp in March and the latest entry has a timestamp of
> 19/1/2017. I want to remove some typo commands that keep coming up in my
> history.
>

As Glenn pointed out the location was changed in the fish 2.3.0 release. I
just wanted to add that you shouldn't edit the file directly. Doing so is
unlikely to cause any problems at this time but it isn't supported and its
possible you won't end up with the desired result. You should instead use
`history delete`. You can safely remove ~/.config/fish/fish_history.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] comparing strings in fish

2017-09-04 Thread Kurtis Rader
On Mon, Sep 4, 2017 at 8:27 AM, Greg Reagle <greg.rea...@umbc.edu> wrote:

> On Mon, Sep 4, 2017, at 11:04, Kurtis Rader wrote:
> > Beware `expr`s automatic coercion of strings to ints. If you do `expr
> '234 < 1234' you'll
> > get false despite "234" being lexically greater than "1234". Which may
> be what you want but
> > it's a potential gotcha if you really wanted a string, not int,
> comparison.
>
> I think you made a mistake or typo there.  You'll get true.  But I see
> your point, and it's a good point.  What about doing
>expr a$v1 '<' a$v2
> to force them to be interpreted as strings?  Any gotchas there?


Yes, the first operand was supposed to be "123". Note, too, that you can't
quote the entire expression like I did. So much for typing a reply off the
cuff without cutting/pasting to make sure it works as expected. Each token
has to be a separate argument. Which is another potential gotcha.  From the
man page:

> All operators and operands must be passed as separate arguments.

So you can't type `expr "$v1 * $v2"`. You have to type `expr $v1 "*" $v2`.
Ugh!

And, yes, your workaround ensures the values are treated as strings and
compared lexicographically since they can't be coerced to ints.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] comparing strings in fish

2017-09-04 Thread Kurtis Rader
On Mon, Sep 4, 2017 at 7:16 AM, Greg Reagle <greg.rea...@umbc.edu> wrote:

> On Sun, Sep 3, 2017, at 20:06, Mark Volkmann wrote:
> > IIUC, there isn't a command in fish that can be used to compare two
> strings to see if one is greater than the other in sorting order. For
> example, this doesn't work:
> >
> > set v1 'foo';
> > set v2 'bar';
> > if test $v1 > $v2
> >   ...
> > end
> >
> > Is there a recommended workaround for this?
>
> The wonderful (POSIX standard) command expr [1] will work.
>
> set v1 foo
> set v2 bar
> if expr $v1 '>' $v2 >/dev/null
> echo true
> else
> echo false
> end
>
> [1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/expr.html


Beware `expr`s automatic coercion of strings to ints. If you do `expr '234
< 1234' you'll get false despite "234" being lexically greater than "1234".
Which may be what you want but it's a potential gotcha if you really wanted
a string, not int, comparison.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] functions generated by alias command

2017-09-02 Thread Kurtis Rader
On Sat, Sep 2, 2017 at 1:56 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> If I enter:
>
> alias greet 'echo Hello, $USER'
>
> and then enter:
>
> functions greet
>
> it outputs:
>
> # Defined in - @ line 0
> function greet --description 'alias greet echo Hello, $USER'
>   echo Hello, $USER $argv;
> end
>
> Why does the generated function output $argv?
>

Most of the time people use `*alias*` to wrap another command with some
predefined options. And you normally want to allow the user to augment
those with additional arguments. For example I have this alias:

alias h 'builtin history search -R -20 --show-time="%a %m-%d %R  "'

If I type `*h git*` I want to search for commands containing the word `*git*`.
It would also be quite surprising to define an alias that silently ignored
any arguments it was invoked with. If you do want a function that should
never be run with any arguments you should do so explicitly:

function greet
if set -q argv[1]
echo greet: no arguments allowed >&2
exit 1
end
echo Hello $USER
end

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] bug in computing COLUMNS?

2017-09-02 Thread Kurtis Rader
On Sat, Sep 2, 2017 at 6:05 AM, Greg Reagle <greg.rea...@umbc.edu> wrote:

> On Fri, Sep 1, 2017, at 15:05, Kurtis Rader wrote:
> > Fish won't work if the terminal height is less than two. I don't recall
> the exact value but
> > it also won't behave sensibly if the width is much less than 20.
>
> Does fish behave better when the width is less than 20 to pretend that
> the width is 80?  What about all the programs that depend on $COLUMNS or
> `tput cols` etc.?  My question is: what is the reason to *mis-represent*
> the width when it's less than 20.
>
> > This tends to happen most often with console VTs where the size is
> frequently reported as
> > zero for both values.
>
> I understand that this can be a problem, but I don't see the relevance,
> i.e. it seems like a different issue.  Checking for zero is different
> than checking for less than 20.  Certainly fish can be programmed to
> fallback to 80x24 if either dimension is reported to be zero.


Fish won't work if COLUMNS is one or two either. As I said earlier I don't
recall now what the exact threshold is but I'm pretty sure it was greater
than ten. Similarly, it won't work if LINES is less than two. So the actual
threshold is not zero versus non-zero. Feel free to do some experiments to
determine the hard lower limit on COLUMNS and ask that it be used as the
hard lower bound rather than 20. Of course, that just moves the goal posts
slightly so it's not clear it really matters at the end of the day. Fish
will not work in a 1x1, 2x2, 5x2, or other similarly sized terminals.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] bug in computing COLUMNS?

2017-09-01 Thread Kurtis Rader
On Fri, Sep 1, 2017 at 9:55 AM, Greg Reagle <greg.rea...@umbc.edu> wrote:

> As seen in commit 2be1288 [1], this is deliberate: "If the resulting
> values are not reasonable fallback to using 80x24."  You can see what is
> considered reasonable in the macro constants MIN_TERM_COL and
> MIN_TERM_ROW defined in common.h [2].  So, if you are compiling fish for
> yourself, you can change these values and recompile.
>
> What I don't understand is what the advantage of this behavior is.  The
> obvious disadvantage is that fish won't work properly when the terminal
> is less than 20 columns.  Whatever the advantage is, does it outweigh
> the disadvantage.  If this fallback logic is kept status quo, would it
> make sense to decrease it from 20 to 10?
>

Fish won't work if the terminal height is less than two. I don't recall the
exact value but it also won't behave sensibly if the width is much less
than 20. Going from memory I'm pretty sure the lower bound is greater than
10. This tends to happen most often with console VTs where the size is
frequently reported as zero for both values. See issue
https://github.com/fish-shell/fish-shell/issues/2559. To give the user a
chance of seeing some output  and typing commands the current code assumes
the stty values are invalid if they are unreasonably small and falls back
to the legacy lowest common denominator of 80x24.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Variable scopes

2017-08-27 Thread Kurtis Rader
On Sun, Aug 27, 2017 at 12:36 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> Ah, I was looking for something like "set --show". Thanks Kurtis!
> Do you know approximately when Fish 2.7 will be released?
>

The date is a bit squishy but it should happen sometime in September.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Variable scopes

2017-08-27 Thread Kurtis Rader
On Sun, Aug 27, 2017 at 6:04 AM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> Suppose I do this:
>
> set foo --local 1
> set foo --global 2
> set foo --universal 3
>
> Assuming the local version is visible in the current code, $foo will
> evaluate to 1.
> Is there a way to retrieve the value of foo in a specific scope like
> global or universal?
> I know I can query whether foo is set in a specific scope, but is there a
> way to get all the values?
>

Sort of. You can't fetch a specific scope using dollar-sign expansion
unless you erase the local and/or global scope instance.  Fish 2.7 has the
`set --show varname` command. This is primarily meant to help debug
perplexing behavior and in things like unit tests:

$ set -U varname universal value
$ set -g varname global is good
$ set -l varname locally handy
$ set --show varname
$varname: set in local scope, unexported, with 2 elements
$varname[1]: length=7 value=|locally|
$varname[2]: length=5 value=|handy|
$varname: set in global scope, unexported, with 3 elements
$varname[1]: length=6 value=|global|
$varname[2]: length=2 value=|is|
$varname[3]: length=4 value=|good|
$varname: set in universal scope, unexported, with 2 elements
$varname[1]: length=9 value=|universal|
$varname[2]: length=5 value=|value|


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] wc counts too many characters when reading __fish_vcs_prompt

2017-08-26 Thread Kurtis Rader
On Sat, Aug 26, 2017 at 3:43 PM, Andrew Toskin <summerfallsa...@gmail.com>
wrote:

> I have my fish prompt configured to show the full absolute path of the
> current working directory, if there's enough room. I do this by running `wc
> --chars` on the full generated prompt, and comparing with $COLUMNS. The
> wc part of this test looks like this:
>
> echo -n "$USER@$__fish_prompt_hostname" ( pwd )( __fish_vcs_prompt ) | wc 
> --chars
>
>
> When in the directory of a local git project, by my count, that echo
> command generates a string that's 59 characters long. However, wc counts
> 101 characters. What's going on here that would explain this 42-character
> discrepency?
>
> When trying to research the issue, I saw a lot of forum posts where wc
> counted one extra character, because echo by default appends a newline, but
> doing echo -n takes care of that issue.
>
> I then thought that maybe wc was counting bytes instead of characters, in
> spite of the --chars switch, but when I copy-paste the generated prompt
> string and echo *that* to wc, it counts the correct number of characters.
> This discrepency only happens in VCS directories, when __fish_vcs_prompt
> has anything to show. Are there 42 control characters involved in setting
> the colors for __fish_vcs_prompt? How do I get an accurate count of the
> characters in my prompt string?
>

As you guessed it's almost certainly escape sequences to color the output.
Run `__fish_vcs_prompt | od -tx1z` to see them. At the moment there is no
good way to get a count of the displayable characters. I opened an issue to
propose implementing a `string width` command to help with this but it
hasn't been implemented yet.



-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] funced and funcsave

2017-08-24 Thread Kurtis Rader
On Thu, Aug 24, 2017 at 3:14 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> It turns out that if I define "rm" as an abbreviation instead of an alias,
> this problem goes away.
>

Yep, because abbreviations only apply to commands entered at an interactive
prompt. In fact, this is a good example where an abbreviation is the better
choice.  Most newcomers to fish are likely to use our `alias` command
thinking it plays a similar role to the bash command of the same name. When
in fact it's `abbr` that is the analog of bash `alias`. We should probably
make that clearer in the docs.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] removing a list item in a function

2017-08-23 Thread Kurtis Rader
On Wed, Aug 23, 2017 at 7:12 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> What am I doing wrong in the function below that accepts the name of a
> variable and an item to be removed and attempts to remove it?
>
> function listrm -a listName item
>   set list $$listName
>   if set -l index (contains -i $item $list)
> set -eg $listName[$index]
>   else
> echo $item was not found in $listName
>   end
> end
>

You've made a subtle mistake that is practically a FAQ. See
http://fishshell.com/docs/current/index.html#expand-variable. You want

set -eg $listName[1][$index]

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] writing error messages

2017-08-20 Thread Kurtis Rader
On Sun, Aug 20, 2017 at 6:02 AM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> What is the recommended way to write out error messages from a fish
> function so they appear in the color that has been configured for error
> messages (typically red)? It seems simply writing to stderr is not the
> answer.
>

Glenn's answer works but if you want to ensure you're using whatever color
standard fish code uses you should use the `$fish_color_error` variable;
e.g., `echo (set_color $fish_color_error)my error message(set_color normal)
>&2`.


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] why all the questions?

2017-08-20 Thread Kurtis Rader
On Sun, Aug 20, 2017 at 3:28 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> On Sun, Aug 20, 2017 at 5:15 PM, Kurtis Rader <kra...@skepticism.us>
> wrote:
>>
>> This statement, "for Window, can only run in Cygwin", isn't true. While
>> we do not, and probably will never support fish as a native command
>> interpreter it can be used in Cygwin and the new Windows 10 "bash"
>> environment (more accurately known as "Windows Subsystem for Linux" or WSL).
>>
>
> Are there notes somewhere that describe how to get fish to run in the
> Windows 10 bash environment?
> That seems preferable over using Cygwin.
>

Not yet. When we started work to ensure fish would run inside WSL that
environment was still in beta status. In theory using the ready made
Debian/Ubuntu packages should work. I suspect most of us who have tested
fisn inside WSL have built it from source.


> Also, keep in mind that fish 3.0, hopefully released 2018Q1, will have
>> many improvements and cleanups. Among them will be replacing the use of
>> `bc` to evaluate math expressions with a builtin command. We already merged
>> changes that can make manipulating fish variables up to 40% faster. See
>> https://github.com/fish-shell/fish-shell/milestone/18 for the current
>> working list. There are many other changes we can only do in a major
>> release that might make it into 3.0. See https://github.com/fish-sh
>> ell/fish-shell/milestone/7 for other items that might make it into 3.0.
>>
>
> Is fish 3 far enough along that I should be learning in that version or do
> you think I should wait for the official release?
>

I recommend new users wait for the official release. The vast majority of
the changes won't break anything people are already doing with fish but
it's always a possibility since the whole point of a major release is to
take some risks. Specifically, making changes that might break existing
fish scripts. And we're currently making changes at a fast rate so you'll
only want to use the bleeding edge version if you're willing to risk some
pain.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] why all the questions?

2017-08-20 Thread Kurtis Rader
On Sun, Aug 20, 2017 at 2:42 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> I hope I'm not being too annoying with all the questions I've been asking.
> Obviously I'm new to fish.
>
> I'm working on writing a long article about it that I'll publish on
> November 1. I want to try to bring more attention to this incredible thing
> that many of you on this mailing list have helped to build. I have a good
> start on the article ... 28 pages of notes! If you're curious, you can see
> them at https://github.com/mvolkmann/MyUnixEnv/blob/
> master/notes/FishNotes.txt. I'm constantly adding to this and will use it
> as the starting point of my article.
>

No worries. Thanks for the heads up. We definitely want to help ensure your
article is as accurate as possible.

I notice the top of your notes asks how `foo; bar` differs from `foo; and
bar`. The `and` keyword is roughly analogous to `foo && bar` in POSIX
shells like bash. The `bar` command will only run if `foo` exits with a
success (zero) status. The reason for the difference is that fish prefers
keeping syntax to a minimum and doing as much as possible via commands.

You ask "Seems to be primarily implemented in C++." That is true. The
original 1.x releases were in C. Then @ridiculous fish and others rewrote
it in C++.

This statement, "for Window, can only run in Cygwin", isn't true. While we
do not, and probably will never support fish as a native command
interpreter it can be used in Cygwin and the new Windows 10 "bash"
environment (more accurately known as "Windows Subsystem for Linux" or WSL).

I see you noticed `fish_indent`. Take a look at `fish_key_reader` too.

Given that you represent a fresh pair of eyes and from looking at your
notes clearly been trying to learn as much from the fish docs as possible
we'd love feedback. Software engineers prefer writing code to documentation
so we don't always give the latter the attention it deserves.

Also, keep in mind that fish 3.0, hopefully released 2018Q1, will have many
improvements and cleanups. Among them will be replacing the use of `bc` to
evaluate math expressions with a builtin command. We already merged changes
that can make manipulating fish variables up to 40% faster. See
https://github.com/fish-shell/fish-shell/milestone/18 for the current
working list. There are many other changes we can only do in a major
release that might make it into 3.0. See
https://github.com/fish-shell/fish-shell/milestone/7 for other items that
might make it into 3.0.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] funced and funcsave

2017-08-20 Thread Kurtis Rader
On Sun, Aug 20, 2017 at 4:49 AM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:
>
> A related question:
> Why does funced ask this question on exit?
> "remove /var/folders/jc/q4_2lrkd3pn2sz1l_s8rf31wgn/T/
> /fish.DjETfi/baz.fish?"
> Is that where it saves temporary (what I referred to as in-memory)
> functions?
> That isn't addressed in the help for funced.
> I'm not sure how my answer to that question affects the function.
>

Technically funced is not asking that question; it's the `rm` command that
funced executes to remove the temporary file it created. The temporary file
is an implementation detail and thus not documented. Apparently you have
done something like `alias rm rm -i`. It might make sense to modify
`funced` to do `rm -f` to override the `-i` option. I don't like doing
that, however, because it also suppresses legitimate errors.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] funced and funcsave

2017-08-19 Thread Kurtis Rader
On Sat, Aug 19, 2017 at 6:42 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> These are really cool utilities!
> Let's see if I understand them correctly.
> I can enter "funced foo" and create a new function named "foo".
> I can immediate execute that by entering "foo".
> But if I exit the session, I'll lose it.
> I can enter "funcsave foo" and it will be written to
> ~/.config/fish/functions/foo.fish.
> Then it will be available in all future sessions.
> Great!
>
> Later I can edit it again with "funced foo".
> However, that just edits the in-memory version of the function.
> It doesn't write the changes to the file unless I run "funcsave foo" again.
>
> I was expecting that funced might realize the function was already saved
> to a file and save the changes there. Either that or I thought there would
> be a switch on funced to tell it to do that.
>
> I'm curious why neither of those is the way it works.
>

First, while `funced` can be used to create a function on the fly it's
primary purpose is to edit an existing function. If I run `funced` more
often than not I am testing something such as a change to my `fish_prompt`
function. And because I'm testing something I do not want that change to be
automatically reflected in the autoloaded script. If I do want a permanent
change I can either run `funced` followed by `funcsave` or just directly
edit the autoloaded script in ~/.config/fish/functions. Existing fish
sessions will notice within  a few seconds that the script file has changed
and reload it.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] status current-line-number

2017-08-19 Thread Kurtis Rader
On Sat, Aug 19, 2017 at 8:22 AM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:
>
> Okay, I see that works.
> But I wonder why current-line-number behaves differently than
> current-function and current-filename.
> I can use parens around those to output them with an echo.
>

Parentheses create a subcommand context -- not a new file or function
context. So when you do `(status current-function)` fish looks walks up the
execution context stack till it finds a function frame and uses that to
extract the function name. Same for `(status current-file)`. What should
`(status current-line)` do? What stack frame should it use? That question
is basically the crux of
https://github.com/fish-shell/fish-shell/issues/4161. Feel free to comment
on that issue.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] status current-line-number

2017-08-19 Thread Kurtis Rader
On Sat, Aug 19, 2017 at 5:37 AM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> I'm doing this inside a function:
> echo at line number (status current-line-number)
> But no matter where I put this in my function, it always outputs 2.
> Am I using it incorrectly?
>

At the moment that feature is pretty much unusable. See
https://github.com/fish-shell/fish-shell/issues/4161


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] default function parameters

2017-08-18 Thread Kurtis Rader
On Fri, Aug 18, 2017 at 5:53 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> I was so close!
> I had this:
> set -q language; or set language 'english'
>
> Why do I need the [1] part?
>

Because fish vars can be set but have no value. Every fish var is an array
which can have zero, one, or more values. `set -q var[1]` is the idiomatic
way to test that the var is not only set but also has at least one value.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] default function parameters

2017-08-18 Thread Kurtis Rader
On Fri, Aug 18, 2017 at 4:12 PM, Greg Reagle <greg.rea...@umbc.edu> wrote:

> On Fri, Aug 18, 2017, at 18:51, Kurtis Rader wrote:
> > Add this to the top of the function:
> >
> > set -q language[1]
> > or set language english
>
> There is a potential problem with the above though.  If $language is set
> to the empty string, the above code will not set language to english
> [1].  I say potential because I don't know if that is a realistic cause
> for a concern or a theoretical possibility that is highly unlikely.  In
> either case, to handle a defined yet empty string, try these (from [1]):


I would argue that if it has been explicitly set to an empty string then it
is in fact set and the default should not be applied. That approach is more
"fishy" since fish does not suffer from the interpolation, extra word
splitting, and other general nastiness of dealing with variables in POSIX
shells like bash. Having said that your advice is good if it is possible
for the var to be set to an empty string and that should be handled
differently from any other random string like "." it might have been set to.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] wildcards ** and ***

2017-08-18 Thread Kurtis Rader
Yes, that verbiage is wrong. I suspect the final sentence was intended to
be this:

In fish you would type **/*.fish to match files ending in ".fish" in
subdirs but not the PWD. If you want to include files in the PWD as well as
subdirs just type **.fish.

On Fri, Aug 18, 2017 at 3:44 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> In the documentation on wildcards I see this:
>
>- ** matches any string of characters. This includes matching an empty
>string. The matched string may include the / character; that is, it
>recurses into subdirectories. Note that augmenting this wildcard with other
>strings will not match files in the current working directory ($PWD)
>if you separate the strings with a slash ("/"). This is unlike other shells
>such as zsh. For example, **\/*.fish in zsh will match .fish files in
>the PWD but in fish will only match such files in a subdirectory. In fish
>you should type ***.fish to match files in the PWD as well as
>subdirectories.
>
> But when I am in a directory that contains .fish files and has
> subdirectories that also contain .fish files, I get the same result from
> "ls **.fish" and "ls ***.fish". Both display matches in the PWD. Is the
> documentation wrong?
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
>


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] default function parameters

2017-08-18 Thread Kurtis Rader
Add this to the top of the function:

set -q language[1]
or set language english

On Fri, Aug 18, 2017 at 3:25 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> What's the best way to provide a default value for a function parameter?
> For example, suppose I have a function like this:
>
> function greet -a name language
>   switch "$language"
> case 'english'
>   echo 'Hello, '$name
> case 'spanish'
>   echo 'Hola, '$name
> case '*'
>   echo unsupported language $language
>   end
> end
>
> If it is called with "greet Bob", I want language to default to 'english'.
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
>


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] use of function --description

2017-08-17 Thread Kurtis Rader
On Thu, Aug 17, 2017 at 8:32 PM, Mark Volkmann <r.mark.volkm...@gmail.com>
wrote:

> Thanks Kurtis!
>
> Suppose I define a function like this:
>
> function foo --description 'Can you see this?'
>   echo in foo
> end
>
> Entering "functions --details foo" just outputs "stdin".
>

Add the verbose flag:

$ functions --verbose --details foo
stdin
n/a
0
scope-shadowing
Can you see this?


I'm new to fish. I don't yet know what a "completion argument function" is.
>

 You said "tab completion" so I assumed you were writing a completion
script using the `complete` command. See `man complete`; specifically the
`--arguments` option.

On Thu, Aug 17, 2017 at 10:20 PM, Kurtis Rader <kra...@skepticism.us> wrote:
>
>> On Thu, Aug 17, 2017 at 8:14 PM, Mark Volkmann <r.mark.volkm...@gmail.com
>> > wrote:
>>
>>> How is the value of --description for a function used?
>>>
>>
>> It is currently used in only one place by the core fish code: the `alias`
>> command.
>>
>>
>>> Is there some command where I can ask for the description of a given
>>> function?
>>>
>>
>> Yes: `functions --details $func_name`.
>>
>>
>>> Is there a way to cause the description to be displayed as part of tab
>>> completion?
>>>
>>
>> Yes, using the aforementioned `functions -details $func_name` command in
>> a completion argument function.
>>
>> --
>> Kurtis Rader
>> Caretaker of the exceptional canines Junior and Hank
>>
>
>
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
>



-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


[Fish-users] if you build from git source please read (git master branch SNAFU)

2017-08-14 Thread Kurtis Rader
If you do not build from source you can ignore the following message. If
you do build from source please read it carefully.

A couple of days ago the fish development team made a mistake. We
inadvertently merged the fish 3.0 (`major`) branch to the 2.7 (`master`)
branch.  At first we thought that just a couple of commits had been merged
to the wrong branch. But it soon became clear that the entire `major`
branch had been merged to `master`. Ironically, this mistake occurred
without anyone immediately noticing because Git has much better support
for branches than nearly every other source code management (SCM) tool.

Because we are just a handful of weeks away from making our final
2.x release we decided to move up the timetable for creating an
`Integration_2.7.0` branch. The `master` branch will become the 3.0.0
development branch and the `major` branch will go away.  This means that
if you build from source you have to decide if you want to test bleeding
edge changes targeted for the 3.0.0 release or remain on the 2.7.0 branch.

If you are willing to test changes that will appear in the 3.0.0 release
you do not need to do anything. Continue to `git pull upstream master`
and build.  If you want to remain on the 2.x branch you will need to
`git pull upstream Integration_2.7.0` and build from that branch.

See

https://github.com/fish-shell/fish-shell/milestone/18

for the changes that have already been made and those we intend to make
in the coming months for the 3.0.0 release. Note that this release will
include backward incompatible changes that might require changes to
your personal fish config or plugins that you use.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Common shell functionality

2017-08-11 Thread Kurtis Rader
On Fri, Aug 11, 2017 at 4:46 AM, Thorsten Kampe <thors...@thorstenkampe.de>
wrote:
>
> - does Fish have an equivalent for getopts? What's the
> recommended solution for parsing command options?
>

Fish 2.7.0, due to be released in a few weeks, as an "argparse" command
that is much easier to use than "getopts".


> - does Fish have an equivalent to the errexit option
> (stop execution on error)?
>

No. See https://github.com/fish-shell/fish-shell/issues/510


> - does Fish have an equivalent to the nounset option
> (treat unset variables as error)?
>

No. See https://github.com/fish-shell/fish-shell/issues/4163


> - does Fish have an equivalent to the xtrace option
> (verbose script execution without full debugging)?
>

Not yet. It's very high on my wishlist but I want to be able to implement
it using fish script. And to do that the "status" command needs some
enhancements. Until then it is sometimes useful to run the script with
`-d3` to better understand the sequence of commands run.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] how do I delete the fish shell history ?

2017-08-09 Thread Kurtis Rader
On Wed, Aug 9, 2017 at 2:45 PM, Robert Carpenter <rob...@robacarp.com>
wrote:

> history clear
>
> sounds to me like it would do the trick based on this:
>
> https://fishshell.com/docs/current/commands.html#history
>
> > • clear clears the history file. A prompt is displayed before the
> history is erased asking you to confirm you really want to clear all
> history unless builtin history is used.
>

Thanks for the reminder, Robert, about `history clear` as I had forgotten
it existed despite being a core developer who fixed many problems with the
`history` command in the past couple of years.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] how do I delete the fish shell history ?

2017-08-09 Thread Kurtis Rader
On Wed, Aug 9, 2017 at 2:42 PM, Luis Manuel Sánchez <
luissanchez...@gmail.com> wrote:

> Would like to reset the history.
>

If you want to selectively delete some items there is the `history delete`
command. Note that fish imports your bash history file if it is empty. So
if you really want an empty history you need to rename or delete your
~/.bash_history file before doing the next step. Exit all your fish shells.
Start /bin/sh or some other non-bash shell then remove your fish history:
rm ~/.local/share/fish/fish_history

 --
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] how to disable scripting help

2017-07-20 Thread Kurtis Rader
I cannot reproduce this.

There isn't anywhere in fish where we run `gawk`. There are a few places
that call `awk` but none of them have the escape sequences in the errors
you showed. So it would appear you have some private customization that is
at fault.

Does the problem still occur if you do `mkdir /tmp/fish` then `env
HOME=/tmp/fish fish`?

On Thu, Jul 20, 2017 at 7:33 PM, Luis Manuel Sánchez <
luissanchez...@gmail.com> wrote:

> hi,
>
> I don't intend to use fish for scripting but when typing and then hitting
> tab I get some warnings
> how can I disable this warnings ?
>
> example:
>
>
> asiaynrf@NA /c/c/testbox# ./ra.gawk: cmd. line:5: warning: escape
> sequence `\('
> treated as plain `('
> gawk: cmd. line:5: warning: escape sequence `\)' treated as plain `)'
> gawk: cmd. line:6: warning: escape sequence `\[' treated as plain `['
> gawk: cmd. line:6: warning: escape sequence `\]' treated as plain `]'
> ./ra.bat  (Executable, 12B)  ./ra.py  (Executable, 1.1kB)
>
>
> the highlighted text above shouldn't show up.
>
> I'm using fish through cygwin32 on Windows 7.
> thanks,
> Luis.
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
>


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


[Fish-users] fish 3.0 under development

2017-07-20 Thread Kurtis Rader
Heads up fish lovers. The team has started working on the next major
release. This will contain a lot of backward incompatible changes. We
expect that all, or nearly all, of the changes won't cause problems for
anyone. But there is always the possibility you're running fish script that
might be affected. For example, we've already merged a change that makes at
least one var name mandatory for the `read` command. You can find the list
of changes likely to be implemented here
<https://github.com/fish-shell/fish-shell/milestone/18>. You can find a
list of changes that might be included here
<https://github.com/fish-shell/fish-shell/milestone/7>.

Fish 2.7.0 will be the last minor release and is targeted for September.
Between now and then it is very unlikely there will be anything but bug
fixes and new completions merged for fish 2.7. That's in addition to the
enhancements that have already been merged
<https://github.com/fish-shell/fish-shell/blob/master/CHANGELOG.md>. After
that there may be fish 2.7.x releases if significant bugs are found.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


[Fish-users] do you call `read` with no var name(s)?

2017-07-16 Thread Kurtis Rader
See issue https://github.com/fish-shell/fish-shell/issues/4220

Is there a reason to continue allowing `read` with no var name(s) to store
the result of the read?

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


[Fish-users] do you use `status current-line-number` or have an opinion about it?

2017-06-24 Thread Kurtis Rader
If you use `status current-line-number` or `status --current-line-number`
or simply have an opinion about how it should behave I invite you to add a
comment to https://github.com/fish-shell/fish-shell/issues/4161. The
current behavior is not very useful. So I'm soliciting feedback on how
people would like it to behave.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] what is wrong with this use of test and $argv?

2017-06-24 Thread Kurtis Rader
While POSIX 1003 compatibility is not a high priority for fish the `test`
command does follow the standard. You'll get a similar error in bash and
zsh. You should always quote the argument to `test -n` and `test -z`. Your
original code has other problems as well. For example, you assume that if
the first arg is `-s` that a second arg is present. Dangerous assumption.
Also, while many people prefer `test -z "$argv"` because that is what they
would do in bash the fishy way to do this is `not set -q argv[1]`

On Sat, Jun 24, 2017 at 2:48 PM, Greg Reagle <greg.rea...@umbc.edu> wrote:

> Hello.  I am using fish version 2.6.0.
>
> I wrote the following script: cat testing-test.fish:
> ---
> #!/usr/bin/fish
>
> test -z $argv; and echo NO argument
> ---
>
> greg@t400 ~/s/bin> ./testing-test.fish
> NO argument
> greg@t400 ~/s/bin> ./testing-test.fish 1
> greg@t400 ~/s/bin> ./testing-test.fish 1 2
> test: unexpected argument at index 2: '2'
> greg@t400 ~/s/bin> ./testing-test.fish 1 2 3
> test: Expected a combining operator like '-a' at index 2
> g
>
> No surprises when called with no command line arguments or with "1", but
> after that it goes off the rails.  Am I doing it wrong?  If so, what is
> the proper fishy way to test for the existence of command line
> arguments?
>
> Note that I discovered this problem in a larger more sophisticated
> script, but I have simplified and condensed it.  The excerpt from my
> actual script is:
> ---
> if test -z $argv;set delay 300
> else if test $argv[1] = -s;  set delay $argv[2]
> else;set delay (expr $argv[1] '*' 60)
> end
> ---
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>



-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


[Fish-users] should we do a fish 3.0 (major) release?

2017-06-21 Thread Kurtis Rader
Please read this issue
<https://github.com/fish-shell/fish-shell/issues/4154> and comment. We have
some non-backward compatible changes we'd like to make and would like input
from the fish user community.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Slow git completions / debugging completions

2017-06-11 Thread Kurtis Rader
Someone else recently asked about the speed of performing git completions.
You might want to follow the discussion here:
https://github.com/fish-shell/fish-shell/issues/4117

On Sun, Jun 11, 2017 at 5:06 AM, Ben Leslie <be...@benno.id.au> wrote:

> Hi all,
>
> I've been using fish for about 6 months now after moving from zsh.
>
> Everything was going well, until recently git sub-command completions have
> slowed down to to point of being unusable.
>
> Specifically:
>
>  git 
>
> is fast, and works as expected
>
> git add 
>
> is very slow (and replace 'add' with any other sub-command).
>
> What is the best way to debug what is going on here?
>
> I tried manually running e.g.:  __fish_git_add_files and it runs fast
>
> Thanks,
>
> Ben
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
>


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Custom completions ignored in ~/.config/fish/completions

2017-06-02 Thread Kurtis Rader
On Fri, Jun 2, 2017 at 4:14 PM, Marcin Zajączkowski <msz...@wp.pl> wrote:
>
> I want to add completion for some Git aliases [1]. When I put a
> "complete" line, e.g.
> > complete -f -c git -n '__fish_git_using_command publish' -a
> '(__fish_git_unique_remote_branches)'
>
> in ~/.config/fish/config.fish it works fine. However, when I put a file
> "gitkurka.fish" in ~/.config/fish/completions (which is mentioned in the
> documentation) with the same line it is ignored (a completion doesn't
> work).
>
> Is there anything else I need to do to make it be found?
>

Fish only autoloads a completion script when a command with the same name
is typed. So when you create a completion script named *gitkurka.fish* the
completions contained within it are only loaded whey you type "gitkurka ".
Presumably you want to augment the base set of git completions provided by
fish. What I would do is put your custom git completions in
~/.config/fish/completions.fish with the first statement in that script
being

source $__fish_datadir/completions/git.fish

Since your custom completion script inhibits loading any completion script
found in the directories enumerated by the $fish_complete_path var you need
to explicitly load the other possible completion scripts.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] How to bind a key sequence to another key sequence?

2017-03-20 Thread Kurtis Rader
On Mon, Mar 20, 2017 at 9:44 PM, Shiyao Ma <i...@introo.me> wrote:
>
> On my terminal, ctrl+enter generates a seq of "^[[27;5;13~"
> I'd like to bind it to a plain "enter".  So pressing ctrl+enter is the
> same as pressing a mere "enter".
>
> I tried
> bind \e"[27;5;13~" \r
>
> but with no success.
>

What you want to do is run `bind \r` which will tell you it is bound to
`execute`. So just `bind \e"[27;5;13~" execute`.

At this time there is no way to write "bind this sequence to the same
commands as this other sequence". It is not clear such a feature would be
useful and unambiguous; e.g., how do you deal with cycles? But if you can
define a sensible syntax and behavior for it please open an issue at
https://github.com/fish-shell/fish-shell/issues/new

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] How to bind a key sequence to another key sequence?

2017-03-20 Thread Kurtis Rader
On Mon, Mar 20, 2017 at 9:19 PM, Shiyao Ma <i...@introo.me> wrote:

> How to bind a key sequence to another key sequence?
>
> Reading the `man bind', I can only figure out how to bind a key sequence
> to a function.
>
> But what about binding it to another key sequence?
>

I do not understand the question. You can bind a key sequence to any
sequence of commands, not just a function. It doesn't make sense to execute
`bind abc ab` where the final `ab` in that command refers to the character
sequence in `bind ab some_function`.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Completion prefixes are invisible

2017-03-13 Thread Kurtis Rader
Fish colors are stored as universal variables. Do `set -U | grep color` to
see them. In this case it is the `fish_pager_color_prefix` that is of
interest.

The basic problem is that fish has no way to determine the background color
of your terminal. So it cannot ensure the colors it uses have sufficient
contrast. You can use the `fish_config` command to launch a GUI in your web
browser that will let you see and change what your color theme, and the
themes shipped with fish, look like when displayed on various background
colors.

On Mon, Mar 13, 2017 at 9:17 AM, Tassilo Horn <t...@gnu.org> wrote:

> Hi all,
>
> I'm a new fish user.  First experience were really good although there's
> one major issue for me.  Assume in my $HOME directory there are two
> files foobar and fooquux.  When I type
>
> ls foo
>
> at the prompt, the possible list of completions looks like
>
>bar  quux
>
> that is, the common prefix I have already typed is not shown in the
> completions.
>
> However, when I copy and paste from the terminal I can see that in fact,
> it shows foobar and fooquux, however it seems like the color is white on
> white.
>
> In the colors tab of fish_config, there's no color to give to common
> completion prefixes which I could change.  (There's also no color for
> globbing patterns * and ? which are currently almost invisible: a very
> light yellow on white background.)
>
> After a bit of fiddeling, I found out that the common completion prefix
> is printed visibly (underlined) when I change my terminal from black
> foreground on white background to white foreground on black background,
> but I don't want to do that.
>
> I tried with both urxvt and gnome-terminal (TERM is xterm-256color in
> both cases).  On a Linux VT, the completion is actually visible.
>
> So what should I do?
>
> Additionally, where does fish save my colors configuration I set in
> fish_config?
>
> Additionally 2: Until this thing is sorted out, I still use zsh as my
> main shell.  But it just occurred to me that when I have a zsh shell and
> start fish by issuing it at the prompt, SHELL will remain /bin/zsh.  Is
> that intensional?
>
> Bye,
> Tassilo
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>



-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] fish_update_completions doesn't produce completions for readelf.

2017-02-24 Thread Kurtis Rader
On Fri, Feb 24, 2017 at 7:48 PM, Shiyao Ma <i...@introo.me> wrote:

> I run `fish_update_completions', but seems it doesn't generate the
> completion from `man readelf'.
>
> Anything I did wrong?
>

No but auto-generated completions are a best-effort situation. Man pages
vary greatly in how they express the arguments a command accepts. Fish's
auto-generated completions will sometimes be missing completely or
sub-optimal for some commands. Note that when asking such a question you
should always a) specify the fish version you are using, and b) the OS you
are using. In this case I can confirm that the newest fish version (from
git head) running on Ubuntu 16.10 fails to create a completion file from
the man page for the `readelf` command.

Feel free to open an issue at
https://github.com/fish-shell/fish-shell/issues/new asking that the
`fish_update_completions` command be improved to handle that man page or
requesting that a custom completion script be written. Note that the issue
is more likely to be resolved quickly if you're willing to create change to
the code :-)

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] What are the limits?

2017-02-14 Thread Kurtis Rader
Your test, Andrew, does not show that fish imposes limits. Quite the
opposite. What you did was similar to the user who ran

read x https://github.com/fish-shell/fish-shell/issues/new


On Tue, Feb 14, 2017 at 8:51 PM, Andrew Toskin <summerfallsa...@gmail.com>
wrote:

> On Tuesday, February 14, 2017, Kurtis Rader <kra...@skepticism.us>
> wrote:
> > The fish shell has no hard code limits on such things. You're
> essentially limited by available memory (or virtual address space).
>
>
> That's what I would have guessed.
>
> But I was suddenly curious, so I thought I'd try. I created a variable,
> foo, that contained an array of identical items -- the letter "a".
>
>   set  foo  a  a  a  a...
>
> That's an awfully slow way to grow a list, but it got me started. I
> then added foo to itself several times.
>
>   set  foo  $foo  $foo  $foo...
>
> And I ran `count` on the growing array between each repitition. I think
> by the second or third time, $foo contained several thousand items --
> but it was still nice and snappy. Then it had about 1.4 million items,
> and count took a couple seconds before it printed the number. Then my
> computer froze just about ground to a halt -- `count` took about 10
> minutes before it reported something like 55 million items. Even after
> killing all running fish processes on my system, everything was a
> little sluggish until I rebooted.
>
> I have kind of an old desktop at home, though. Your mileage may vary.
>
>
> > If you're doing something where such limits are a concern you
> should be using a different language such as C++, Java or Python.
>
>
> Yup, haha, if you need to do some serious programming work, pick a
> serious programming language.
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>



-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Possibly broken echoing

2017-02-13 Thread Kurtis Rader
Please open an issue at https://github.com/fish-shell/fish-shell/issues/new

It looks like the PROMPT_SP hack to deal with output from a command that
does not end with a newline has been broken. Note that this does not happen
if the output has more than a single character so we probably have an off
by one error somewhere in the code. I wonder if zsh has the same bug since
we copied that implementation.

Note that you can see the character is actually written by using the
`script` command to capture all output.

On Mon, Feb 13, 2017 at 7:33 PM, Giuseppe Calabrese <giu...@gmx.com> wrote:

> Hello everyone,
>
> When I try to print a single non-control character to the terminal, I
> get nothing back. I tried different terminals and shells; it happens
> everywhere, only with Fish.
>
> echo -n x # prints nothing
> printf "%d" 9 # idem
> printf "%s" Y # idem
> printf "%x" 15# idem
>
> echo x# prints "x\n"
> printf "%s" Yep   # prints "Yep"
> printf "%02x" 15  # prints "0f"
> printf "%d" 10# prints "10"
> printf "%x" 16# idem
>
> echo  # prints "\n"
> printf \n # idem
> printf \a # plays sound
>
> This problem affects any program run under Fish which prints to
> stdin/stderr, e.g.:
>
> printf 'int main() { printf("x"); }' \
>   | cc -x c -w - -o test-prog\
>   ; ./test-prog
>
> Since, however, printing to other files, pipes, etc. seems to work,
> the issue must concern echoing.
>
> echo (echo -n x)# prints "x\n"
> printf "%s\n" (printf x)# idem
> printf x\n | cat > test-file; cat test-file # idem
>
> Can anyone reproduce with Fish 2.5.0?
>
> Giuseppe
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>



-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Fish runtime dependencies

2017-02-09 Thread Kurtis Rader
We check whether the backtrace functions are available at configure time.
See "AC_CHECK_FUNCS( backtrace_symbols getifaddrs )" in configure.ac.

On macOS and GNU Linux those routines are in libc. Please open an
enhancement issue if we need additional autoconf tests to check if
libexecinfo needs to be added to the list of libraries we link against.
Which appears to be the case for FreeBSD.

On Wed, Feb 8, 2017 at 10:26 PM, Mizsei Zoltán <miq...@gmail.com> wrote:

> Hi Guys,
>
> i just noticed, the compiled fish binary doesn’t depend on libexecinfo,
> whovewer  it checks for backtrace in compile time.
> Does it a compile-time dependency or, runtime-dep, or both?
>
> I’m on my way to reduce the build-time dependencies to the minimum on
> Haiku, here is my current recipe: https://github.com/
> haikuports/haikuports/blob/master/app-shells/fish/fish-2.5.0.recipe
>
> As you can see, libexecinfo (what provides the backtrace support on Haiku
> and on some other platforms) defined as build and as runtime dep, but
> examining the created binary it doesn’t require this lib. Does fish require
> just the declarations form the header file, but not the actual library?
>
> Thanks for all the fish!
>
> —miqlas
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
>


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] find fish and basename

2017-01-31 Thread Kurtis Rader
On Tue, Jan 31, 2017 at 3:59 AM, Henning Reich <f...@qupfer.de> wrote:

> Thanks for all the answers, I also found a solution, that worked for
> me...just not using fish ;-)
> find / -iname "*.pcap" -exec  sh -c 'touch /tmp/$(basename {})' \;


That will work with fish as well with one small syntax change:

 find / -iname "*.pcap" -exec fish -c 'touch /tmp/(basename {})'  \;

or, using your original example:

find /search/path -iname "*.pcap" -exec fish -c '/path/to/tool -para1 $path
-para2 /tmp/results/(basename {})' \;

The only reason I didn't recommend the `-exec` solution is it's less
efficient than the alternatives. It's also often harder to read which can
lead to mistakes.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] find fish and basename

2017-01-30 Thread Kurtis Rader
On Mon, Jan 30, 2017 at 5:43 AM, Henning Reich <f...@qupfer.de> wrote:
>
> I want to use the results of 'find' and also for output naming.
> My first try/idea looks like
>
> find /search/path -iname "*.pcap" -exec /path/to/tool  -para1 "{}"
> -para2 /tmp/results(basename "{}")
>
> But this will resolve para2 with /tmp/results/search/path/name and not
> /tmp/results/name.
> What I am doing wrong?
>

The problem is that the command substitution (the thing between the parens)
is run once when you press [enter]. It is not run for each matching file
name. You need to do this via a script. Something like (untested):

find /search/path -iname "*.pcap" -print0 | while read -z path
set -l basename (basename $path)
/path/to/tool  -para1 $path -para2 /tmp/results/$basename
end

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Recent change broke INT handling?

2017-01-25 Thread Kurtis Rader
We should end this thread since I can reproduce the problem and it clear
there is a real bug introduced in the past couple of days with commit
ab189a7
<https://github.com/fish-shell/fish-shell/commit/ab189a75abeeeaf5cbddc2ffc7e865567fb39bc6>.
Further discussion should take place here:
https://github.com/fish-shell/fish-shell/issues/3780

On Wed, Jan 25, 2017 at 7:40 PM, David B. Lamkins <da...@lamkins.net> wrote:

> On Wed, Jan 25, 2017 at 07:26:17PM -0800, David B. Lamkins wrote:
> > Just to be clear, I'm doing
> >
> > > git checkout f4476100
> >
> > That looks like the head of a branch, iothread_perform_lambda, that has
> several other commits.
>
> Correction. Not the head. I used git gui for the first time and
> misinterpreted the output. But it's definitely that branch.
> >
> >
> >
> > On Wed, Jan 25, 2017 at 07:13:15PM -0800, Kurtis Rader wrote:
> > > Your testing suggests the problem is not deterministic. Which is not
> surprising
> > > since SIGINT handling has always been slightly flakey. But there is
> absolutely
> > > no way commit f4476100 can "restore proper ^C behavior." Just do `git
> log -p -1
> > > f4476100` to see that it cannot possibly change the behavior of fish
> since all
> > > it does is change a comment. In fact, it shouldn't even change the
> probability
> > > of hitting the problem since it should not even change the code that is
> > > emitted. I have to wonder if there is something wrong with your testing
> > > methodology. Having said that, I can reliably reproduce the problem
> starting
> > > with commit ab189a7 thru git head and cannot reproduce it prior to
> that commit.
> > > Both on macOS 10.12 and Ubuntu 16.10.
> > >
> > > On Wed, Jan 25, 2017 at 6:53 PM, David B. Lamkins <[1]
> da...@lamkins.net> wrote:
> > >
> > > Heh. Fair enough. :) This is a different system than the one on
> which I
> > > noticed the problem this morning. Also, I neglected to do a clean
> build. So
> > > let me be more rigourous about building and testing, this time...
> > >
> > > With
> > > > ./configure; and make clean all; and sudo make install
> > > ... followed by starting a fresh shell, commit f4476100 does
> indeed restore
> > > proper ^C behavior. Huh?
> > >
> > > I did have to run that twice. The first build failed with
> > > make: *** No rule to make target 'FISH-BUILD-VERSION-FILE', needed
> by 'obj/
> > > fish_version.o'.  Stop.
> > >
> > > OK... I do have local changes to share/functions/fish_vi_cursor.fish
> . I
> > > don't think that's related in any way, but for completeness I did
> a git
> > > stash and repeated as above. Same outcome.
> > >
> > >     I switched back to the master branch and repeated the above. Same
> issue
> > > with the first build attempt. Success on the second attempt.
> > >
> > > With the build from the master branch installed (I didn't bother
> to stash
> > > my local fish_vi_cursor.fish, since that didn't affect previous
> outcomes),
> > > ^C doesn't work.
> > >
> > >
> > >
> > > On Wed, Jan 25, 2017 at 06:23:17PM -0800, Kurtis Rader wrote:
> > > > On Wed, Jan 25, 2017 at 6:04 PM, David B. Lamkins <[1][2]
> > > da...@lamkins.net> wrote:
> > > >
> > > > Commit f4476100 does correct the problem.
> > > >
> > > >
> > > > Not on my system. And it isn't possible for that commit to fix
> the
> > > problem
> > > > because it only changes a comment. This is the entirety of that
> change:
> > > >
> > > > -/// A class to aid iteration over jobs list. Note this is used
> from a
> > > signal
> > > > handler, so it must be
> > > > -/// careful to not allocate memory.
> > > > +/// A class to aid iteration over jobs list
> > > >
> > > > --
> > > > Kurtis Rader
> > > > Caretaker of the exceptional canines Junior and Hank
> > > >
> > > > References:
> > > >
> > > > [1] mailto:[3]da...@lamkins.net
> > >
> > >
> > >
> > >
> > > --
> > > Kurtis Rader
> > > Caretaker of the exceptional canines Junior and Hank
> > >
> > > References:
> > >
> > > [1] mailto:da...@lamkins.net
> > > [2] mailto:da...@lamkins.net
> > > [3] mailto:da...@lamkins.net
>



-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Recent change broke INT handling?

2017-01-25 Thread Kurtis Rader
On Wed, Jan 25, 2017 at 7:40 PM, David B. Lamkins <da...@lamkins.net> wrote:

> Correction. Not the head. I used git gui for the first time and
> misinterpreted the output. But it's definitely that branch.


Ignore that the change originated on ridiculousfish's `iothread_perform_lambda`
branch. It is irrelevant unless you have done `git checkout
iothread_perform_lambda`
which is something you should not be doing. All that matters is the
`master` branch unless you are reviewing a pull-request and want to test
the branch associated with that PR.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Recent change broke INT handling?

2017-01-25 Thread Kurtis Rader
On Wed, Jan 25, 2017 at 7:26 PM, David B. Lamkins <da...@lamkins.net> wrote:

> Just to be clear, I'm doing
>
> > git checkout f4476100
>
> That looks like the head of a branch, iothread_perform_lambda, that has
> several other commits.
>

Huh? After I do that checkout running `git log --stat -100` reports the
following. I think you are being confused by ridiculousfish's propensity to
let his private branches bleed into the github repo. In this case
https://github.com/fish-shell/fish-shell/commits/iothread_perform_lambda.
Ignore that he was working on a private branch. It isn't relevant. What is
relevant is that the change you're fixated on does nothing other than
change a comment. From `git log -p -1 f4476100`:

commit f4476100f28880e7fad660fefed118ef2521633c
Author: ridiculousfish <corydo...@ridiculousfish.com>
Date:   Sun Jan 22 00:59:50 2017 -0800

Remove comment about job_iterator_t being used from signal handlers

It is no longer used from signal handlers, and has not been for a while

diff --git a/src/proc.h b/src/proc.h
index 9d0508f1..7990174d 100644
--- a/src/proc.h
+++ b/src/proc.h
@@ -249,8 +249,7 @@ typedef std::list job_list_t;

 bool job_list_is_empty(void);

-/// A class to aid iteration over jobs list. Note this is used from a
signal handler, so
-/// careful to not allocate memory.
+/// A class to aid iteration over jobs list
 class job_iterator_t {
 job_list_t *const job_list;
 job_list_t::iterator current, end;


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Recent change broke INT handling?

2017-01-25 Thread Kurtis Rader
Your testing suggests the problem is not deterministic. Which is not
surprising since SIGINT handling has always been slightly flakey. But there
is absolutely no way commit f4476100 can "restore proper ^C behavior." Just
do `git log -p -1 f4476100` to see that it cannot possibly change the
behavior of fish since all it does is change a comment. In fact, it
shouldn't even change the probability of hitting the problem since it
should not even change the code that is emitted. I have to wonder if there
is something wrong with your testing methodology. Having said that, I can
reliably reproduce the problem starting with commit ab189a7 thru git head
and cannot reproduce it prior to that commit. Both on macOS 10.12 and
Ubuntu 16.10.

On Wed, Jan 25, 2017 at 6:53 PM, David B. Lamkins <da...@lamkins.net> wrote:

> Heh. Fair enough. :) This is a different system than the one on which I
> noticed the problem this morning. Also, I neglected to do a clean build. So
> let me be more rigourous about building and testing, this time...
>
> With
> > ./configure; and make clean all; and sudo make install
> ... followed by starting a fresh shell, commit f4476100 does indeed
> restore proper ^C behavior. Huh?
>
> I did have to run that twice. The first build failed with
> make: *** No rule to make target 'FISH-BUILD-VERSION-FILE', needed by
> 'obj/fish_version.o'.  Stop.
>
> OK... I do have local changes to share/functions/fish_vi_cursor.fish . I
> don't think that's related in any way, but for completeness I did a git
> stash and repeated as above. Same outcome.
>
> I switched back to the master branch and repeated the above. Same issue
> with the first build attempt. Success on the second attempt.
>
> With the build from the master branch installed (I didn't bother to stash
> my local fish_vi_cursor.fish, since that didn't affect previous outcomes),
> ^C doesn't work.
>
>
>
> On Wed, Jan 25, 2017 at 06:23:17PM -0800, Kurtis Rader wrote:
> > On Wed, Jan 25, 2017 at 6:04 PM, David B. Lamkins <[1]da...@lamkins.net>
> wrote:
> >
> > Commit f4476100 does correct the problem.
> >
> >
> > Not on my system. And it isn't possible for that commit to fix the
> problem
> > because it only changes a comment. This is the entirety of that change:
> >
> > -/// A class to aid iteration over jobs list. Note this is used from a
> signal
> > handler, so it must be
> > -/// careful to not allocate memory.
> > +/// A class to aid iteration over jobs list
> >
> > --
> > Kurtis Rader
> > Caretaker of the exceptional canines Junior and Hank
> >
> > References:
> >
> > [1] mailto:da...@lamkins.net
>



-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Recent change broke INT handling?

2017-01-25 Thread Kurtis Rader
On Wed, Jan 25, 2017 at 6:04 PM, David B. Lamkins <da...@lamkins.net> wrote:

> Commit f4476100 does correct the problem.
>

Not on my system. And it isn't possible for that commit to fix the problem
because it only changes a comment. This is the entirety of that change:

-/// A class to aid iteration over jobs list. Note this is used from a
signal handler, so it must be
-/// careful to not allocate memory.
+/// A class to aid iteration over jobs list

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Recent change broke INT handling?

2017-01-25 Thread Kurtis Rader
On Wed, Jan 25, 2017 at 10:12 AM, David B. Lamkins <dlamk...@galois.com>
wrote:

> fish, version 2.4.0-418-gec19159-dirty
>
> Is it just me, or is ^C handling broken?
>
> $ while true; echo here; sleep 1; end
>
> Typing ^C does not interrupt the loop as expected.
>

Thanks for bringing this to our attention. I've opened
https://github.com/fish-shell/fish-shell/issues/3780

If you can confirm that building fish from commit f4476100 works for you
that would be appreciated.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] MacOs: Command-Delete binding

2017-01-04 Thread Kurtis Rader
On Wed, Jan 4, 2017 at 7:50 AM, Pito Salas <pitosa...@gmail.com> wrote:

> Looking through the doc for the bind command I see how to annotate
> “option-“ commands (\ex) and “control-“ (\cx) but not “command-“. Can
> someone point it out for me, thanks!
>

Terminal.app does not allow you to use the command key to send char
sequences to the shell. iTerm.app does let you define sequences involving
the command key but does not define any by default. In both terminals you
have to explicitly enable the "use option as meta" option to be able to use
it to modify the sequence sent by other keys. iTerm.app allows you to do so
for left-option and right-option independent of each other while
Terminal.app has a single configurable setting that applies to both option
keys.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Unexpanded arguments?

2016-12-19 Thread Kurtis Rader
On Mon, Dec 19, 2016 at 9:00 AM, Mike Meyer <m...@mired.org> wrote:

> Is it possible to get to the unexpanded arguments inside a function? It'd
> be nice to do something like (from zsh):
>

No, it isn't. See  https://github.com/fish-shell/fish-shell/issues/1511


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] `` vs ()

2016-12-12 Thread Kurtis Rader
On Mon, Dec 12, 2016 at 2:31 PM, John Chludzinski <
john.chludzin...@gmail.com> wrote:

> On the Bourne shell I  can use:
>
> sh-4.1$ gcc `pkg-config gtk+-2.0 --cflags` `pkg-config gtk+-2.0 --libs`
> dbuscomm.c
>
>
> When I try (in Fish):
>
> > gcc (pkg-config gtk+-2.0 --cflags) (pkg-config gtk+-2.0 --libs)
> dbuscomm.c
>
> I get a whole bunch of bogus compile errors.
>
> Why?
>

It's because POSIX shells like bash split the subcommand output on
whitespace while fish only splits on newlines. Since `pkg-config gtk+-2.0
--cflags` produces a single line of output fish passes that as a single
argument (i.e., a single string) to gcc which is understandably confused.
See https://github.com/fish-shell/fish-shell/issues/1947 and
https://github.com/fish-shell/fish-shell/issues/2568 and

http://stackoverflow.com/questions/28128669/fish-command-substitution-doesnt-work-like-in-bash-or-zsh/28129450#28129450

However, rather than using `tr` as suggested in that SO thread I would
recommend using the `string split` builtin.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] How to expand wildcard?

2016-11-30 Thread Kurtis Rader
On Wed, Nov 30, 2016 at 5:54 PM, Shiyao Ma <i...@introo.me> wrote:

> Sorry I didn't make my question clear.
>
> Basically, I'd like to have an equivalent of the Bash's "glob-expand-word
> (C-x *)".
>
> Given a folder with files a{a,b,c} inside.
> ls a*<*> will expand to ls aa ab ac.
>
> Is there any equivalent function in fish so I can map Tab to it ?
>

No, however writing such a function should be easy.  In fish you can bind
arbitrary functions, including ones that you write, to keystrokes. See the
`commandline` command for how to fetch the token under the cursor and
insert text into the command line. It's possible someone has already
written such a function. You might want to check the Fisherman and
Oh-My-Fish plugin repositories before writing your own.


> Also, bash has "insert-completions (M-*)", does fish also has equivalent
> of this one?
>

I don't know what that does. Fish already has a pretty good completion
system that will suggest appropriate flags and subcommands depending on
what you have already typed.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Porting Fish shell to Haiku

2016-11-30 Thread Kurtis Rader
On Wed, Nov 30, 2016 at 12:07 PM, Mizsei Zoltán <miq...@gmail.com> wrote:
>
> I’m on my long way to get Fish properly ported to Haiku. I’ve already did
> some efforts, we have an working recipe [1], but i’m not really happy yet.
> So i have the following problems to solve:
>
> - The latest (2.4.0) Fish hangs sometimes if i press Ctrl-C in Terminal.
> One CPU load goes high and i need to kill the Fish instance to get
> everything back to normal. Have you seen anything like this on other
> platform?
>

Not that I can recall. You're best bet is to attach to the spinning process
with a debugger and start by printing a backtrace using `bt` or whatever
command your debugger has for that purpose.


> - The fish_config script trying to create the /boot/home/config/cache/fish
> folder, but cannot handle the situation if this folder already there. I get
> just a traceback, so i need to delete this folder every time if i try to
> start the web interface. Error : [2]
>

It wouldn't use that directory unless you've exported a XDG_CACHE_HOME env
var. By default it will put the file in ~/.cache/fish.


> - The fish_update_completions cannot find something, i get a python
> traceback, complaining about “No such file or directory”. Any idea, what it
> trying to do? Error: [3]
>

Need more data. Please open an issue that includes the python traceback.


> - At starting Fish i get the following text 2 times:
> "socket: Address family not supported by protocol family"
> I already created a bugreport about it on the github page. [4] There is no
> en0/eth0 on Haiku. Is there any way to fix this?
>

None of the core devs are using Haiku so we have to rely on someone like
yourself to create a change that makes fish compatible with whatever scheme
Haiku uses for its networking interfaces.


> - My patch extending the open.fish script with the Haiku’s open case,
> however it isn’t required. Where can i define, that this aren’t required on
> Haiku?
>

I would ignore that for now by just defining your own
~/.config/fish/functions/open.fish autoload script that is empty. We have a
PR open, https://github.com/fish-shell/fish-shell/pull/3571, that is likely
to remove that function.


> - Is this latest release "LastC++03” an official one? Have not seen any
> info about it.
>

As of a week ago we now require a C++11 compliant compiler.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] external command inside function fails on OSX

2016-11-30 Thread Kurtis Rader
The problem is the output of `hdiutil` includes trailing spaces and tabs:

$ hdiutil attach -nomount ram://2097152 | od -tx1z
000 2f 64 65 76 2f 64 69 73 6b 36 20 20 20 20 20 20  >/dev/disk6  <
020 20 20 20 20 09 20 20 20 20 20 20 20 20 20 20 20  >.   <
040 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  ><
060 20 20 20 20 09 0a>..<
066

That isn't an issue in zsh due to the way commands are split more than once
on $IFS chars. You can fix the output by piping it through `string trim`.
For example,

function ramdisk
# calculate a size in GB for a new ramdisk
set -l size (math "$argv[1] * 2 * 1024^2")
# ensure any existing ramdisk is unceremoniously dumped
diskutil eject /Volumes/ramdisk >/dev/null 2>&1
# create an unformatted ramdisk - works
set -l ramdiskpath (hdiutil attach -nomount ram://$size | string trim)
# format the disk using the path - fails
diskutil erasevolume 'HFS+' ramdisk $ramdiskpath
end

Notice that I'm also using `set -l` to create local vars so as not to
pollute the global namespace if those vars happen to be defined globally.
I'm also using the clearer `2 * 1024^2` than the literal value for 2MiB.
I'd also recommend sanity checking that $argv[1] is set to a sane value.

On Wed, Nov 30, 2016 at 5:14 AM, Dave Cottlehuber <d...@skunkwerks.at> wrote:

> Hi fisherfolk,
>
> This is a copy-pasta function from my previous zsh setup, on OSX., to
> create a ramdisk of X Gb. Unfortunately the final command, diskutil
> erasevolume ... fails unless run manually. I've tried sleep 5,
> sprinkling quotes, wrapping it in (...) but nada. Any idea why?
>
> fish 2.3.1 via homebrew on OSX
>
> ```fish
> function ramdisk
> # calculate a size in GB for a new ramdisk
> set size (math "$argv[1] * 2097152")
> # ensure any existing ramdisk is unceremoniously dumped
> diskutil eject /Volumes/ramdisk >/dev/null 2>&1
> # create an unformatted ramdisk - works
> set ramdiskpath (hdiutil attach -nomount ram://$size)
> # format the disk using the path - fails
> diskutil erasevolume HFS+  ramdisk $ramdiskpath
> end
> ```
>
> $ ramdisk 12
>
> Unable to find disk for /dev/disk1
>
> -- sadpanda --
>
> $ diskutil list
>
> /dev/disk0 (internal, physical):
>#:   TYPE NAMESIZE
>IDENTIFIER
>0:  GUID_partition_scheme*3.0 TB
>disk0
>1:EFI EFI 209.7 MB
>disk0s1
>2:  Apple_HFS continuity  299.5 GB
>disk0s2
>3: Apple_Boot Recovery HD 650.0 MB
>disk0s3
>4: 516E7CBA-6ECF-11D6-8FF8-00022D09712B   2.7 TB
>disk0s4
>
> /dev/disk1 (disk image):
>#:   TYPE NAMESIZE
>IDENTIFIER
>0:   +12.9 GB
>disk1
>
> -- do it manually --
>
> $ diskutil erasevolume HFS+ ramdisk "/dev/disk1"
> Started erase on disk1
> Unmounting disk
> Erasing
> Initialized /dev/rdisk1 as a 12 GB case-insensitive HFS Plus volume
> Mounting disk
> Finished erase on disk1 ramdisk
>
> A+
> Dave
>
> 
> --
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>



-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] How to expand wildcard?

2016-11-30 Thread Kurtis Rader
On Wed, Nov 30, 2016 at 4:37 AM, Shiyao Ma <i...@introo.me> wrote:
>
> Say I have three files, aa, ab, and bb
> I want to delete aa and ab.
>
> Normal, I would do: rm -f a*.  And hope  will exapnd a* to
> aa,ab. so that I can confirm that's what I want to delete.
>
> But fish won't expand.
>

Omit the asterisk. Filename completion does fuzzy literal matching. It
doesn't support wildcards or regexes.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Completion on a function

2016-11-25 Thread Kurtis Rader
On Fri, Nov 25, 2016 at 7:54 PM, Shiyao Ma <i...@introo.me> wrote:

> Is it possible to see what a command is wrapped to?
>
> Like, 'fish_wrapped_by e' gives env.
>

I think the only practical solution is to run `complete` (no arguments or
flags) and find `--command e` and see if it has a `--wraps` flag.

FWIW, I think the `complete` command should have a query option to make it
easy to output only the completions for a specific command. That's another
enhancement request someone could make if they felt strongly about it.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Completion on a function

2016-11-25 Thread Kurtis Rader
On Fri, Nov 25, 2016 at 7:46 PM, Shiyao Ma <i...@introo.me> wrote:

> Thanks.
>
> Problem solved.
>

You're welcome. For the record the issue about `functions $funcname` not
showing the `--wraps` flag is issue #1625
<https://github.com/fish-shell/fish-shell/issues/1625>.


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] How to specify the completion layout length?

2016-11-25 Thread Kurtis Rader
No, you cannot customize the completion layout. Fish tries really hard to
avoid needing to "knobs" the user can tweak to customize such things.
You're welcome to open an issue describing why you want to have more
control over the layout. But don't be surprised if the answer is "no, we're
not going to provide a way to let the user customize the layout." However,
depending on how you explain why you want a different layout we might
improve the auto-layout.

On Fri, Nov 25, 2016 at 7:41 PM, Shiyao Ma <i...@introo.me> wrote:

> Hi,
>
>
> In the following snapshot:
> http://imgur.com/a/Bq6Mz
>
> the completion list is layout in a Nx5 grid.
>
> can I make it layout in Nx8 or Nx8, etc?
>
> Regards.
>
>
>
>
>
> --
>
> 吾輩は猫である。ホームーページはhttps://introo.me <http://introo.me>。
>
> 
> --
>
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
>


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Completion on a function

2016-11-25 Thread Kurtis Rader
The problem is that `alias` is just a wrapper that creates a `function`.
And while `functions e` doesn't show it (a known issue) the `alias` command
did `function e --wraps env`. So the solution is don't use `alias`. Just
define the function yourself:

function e
env MY_PWD=$PWD emacsclient -t -a "" ^/dev/null
end

Note that you'll need to start a new shell, or manually delete the
completion for `e`, to stop seeing the completions for the `env` command.

On Fri, Nov 25, 2016 at 7:02 PM, Shiyao Ma <i...@introo.me> wrote:

> Hi,
>
> I've this alias:
> alias e 'env MY_PWD=$PWD emacsclient -t -a "" ^/dev/null'
>
> when I type: e ,
> fish will complete as if I've typed: env .
>
> Indeed, I only want: e  to give a list of files in current dir.
> How to achieve the above effect?
>
>
> Thanks.
>
> --
>
> 吾輩は猫である。ホームーページはhttps://introo.me <http://introo.me>。
>
> 
> --
>
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
>


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Fish and /etc/profile ?

2016-11-02 Thread Kurtis Rader
On Wed, Nov 2, 2016 at 8:49 AM, John Chludzinski <john.chludzin...@gmail.com
> wrote:

> I have fish as my default shell. It appears that /etc/profile is not being
> executed.
>

Fish does not read /etc/profile. Fish can't read it because fish does no
support the POSIX 1003 standard for shell syntax. The closest analog in
fish is /etc/fish/config.fish (or wherever $__fish_sysconfdir points). And,
of course, the equivalent of ~/.profile is ~/.config/fish/config.fish.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Using Math

2016-10-22 Thread Kurtis Rader
Sorry, my memory was faulty. I thought that change was merged in time for
the 2.3.0 release. It was not. You'd have to use the 2.4.0b1 release (beta
of the next release) or build fish from git head to get that feature.

On Sat, Oct 22, 2016 at 10:37 AM, Lists <barn...@drofle.co.uk> wrote:

> On 22/10/16 18:14, Kurtis Rader wrote:
> > If you're using fish 2.3.0 or newer (e.g., git head) we already support
> > this: e.g., math -s5 10 / 3
> >
>
> Well, when I try fish --version
>
> I get 2.3.1
>
> When I try echo (math -s5 10/3)
>
> I get a syntax error.
>
> Something I am missing here?
>
> Neil
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>



-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Using Math

2016-10-22 Thread Kurtis Rader
If you're using fish 2.3.0 or newer (e.g., git head) we already support
this: e.g., math -s5 10 / 3

On Sat, Oct 22, 2016 at 8:38 AM, Glenn Jackman <jack...@pythian.com> wrote:

> Can't test right now but this should work
>
> function bc
> begin
> echo scale=6
> cat
> end | command bc
> end
>
> --
> Glenn Jackman
> Software Developer
>
> Pythian - Love your data
>
> jack...@pythian.com
> Mobile: +1 613 808 4984
> www.pythian.com
>
> On Oct 22, 2016 3:41 AM, "Lists" <barn...@drofle.co.uk> wrote:
>
>> On 21/10/16 19:04, Glenn Jackman wrote:
>> > As the math function uses `bc`, I alias `bc` to `bc -l`
>> >
>> > $ math 3/4
>> > 0
>> > $ function bc; command bc -l $argv; end
>> > $ math 3/4
>> > .7500
>> >
>> >
>> >
>> Have not tried that. I  see that you have set up a function. It does
>> give a lot of decimal places which I am trying to avoid. I use the
>> following, as an example, to get 22/7.
>>
>> echo (echo "scale=6; 22/7" | bc)
>> 3.142857
>>
>> If I change the scale to 8, for example,  I get 3.14285714
>>
>> The query I was referring to was setting the number of decimal places in
>> the answer. That is my way. There are probably better ways.
>>
>> Neil
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> ___
>> Fish-users mailing list
>> Fish-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/fish-users
>>
>
> --
>
>
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
>


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] issues after upgrading from 2.2.0 to 2.3.1 - alias & key mappings

2016-09-20 Thread Kurtis Rader
I looked at your config and it looks fine. As @faho intimated this is
almost certainly a locale related problem. You have


   1. set -x LC_ALLen_US.UTF-8


at the bottom of your config.fish. What happens if you move that to the top
of your config.fish? If you don't change anything but simply run "fish" to
start an interactive subshell do you still see those errors? If not then
the problem is probably that your locale is weird when the initial login
shell is launched.

On Tue, Sep 20, 2016 at 12:07 PM, Dave Cottlehuber <d...@skunkwerks.at>
wrote:

> hi all,
>
> after updating my FreeBSD boxes today, I get:
>
> - arrow key mapping don't work, displaying instead  [A for up arrow etc,
> [D instead of backspace etc. line completion is also broken.
>
> - errors from my previously-working aliases at ssh login time:
>
> alias: Name cannot be empty
> alias: Name cannot be empty
> alias: Name cannot be empty
> ... 1 per every alias definition in ~/.config/fish/config.fish
>
> the aliases themselves are all harmless things like this:
>
> alias l '/bin/ls -AFGhl'
> alias d '/bin/ls -AFGh'
>
> I have a minimal install, including fisher, but removing plugins has no
> effect.
>
> The other possibly enlightening error is this:
>
> @ ~/usr/home/dch> fisher ls
> Mismatched brackets
> in function “fisher”
> called on standard input
> with parameter list “ls”
>
> Invalid redirection target:
> ~/.config/fish/functions/fisher.fish (line 83): echo
> "$fisher_cmd_name --complete" > "$completions"
>
>  ^
> in function “fisher”
> called on standard input
> with parameter list “ls”
>
> No code specified for -e.
> Invalid redirection target:
> ~/.config/fish/functions/fisher.fish (line 329): echo >
> "$fisher_file"
>   ^
> in function “fisher”
> called on standard input
> with parameter list “ls”
>
> any ideas?
>
> https://dpaste.de/dEB8 is my full config.fish.
>
> A+
> Dave
>
>
>
> --------
> --
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>



-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Default fish shell coloring not appearing

2016-08-01 Thread Kurtis Rader
The key difference is probably this entry:

fisher_active_prompt mono

On Mon, Aug 1, 2016 at 6:17 PM, Pito Salas <pitosa...@gmail.com> wrote:

> Interesting. There are a variety of differences, but the first one is
> especially interesting. Notice the first line,
> “__fish_classic_git_prompt_initialized”. Is that important? Do you see any
> other clues?
>
> SET U ON COMPUTER WHERE SHELL USES BLACK TEXT ON WHITE BACKGROUND:
>
> __fish_classic_git_prompt_initialized
> __fish_init_1_50_0
> __fish_init_2_3_0
> fish_color_autosuggestion 555
> fish_color_command 005fd7
> fish_color_comment 99
> fish_color_cwd green
> fish_color_cwd_root red
> fish_color_end 009900
> fish_color_error ff
> fish_color_escape cyan
> fish_color_history_current cyan
> fish_color_host normal
> fish_color_match cyan
> fish_color_normal normal
> fish_color_operator cyan
> fish_color_param 00afff
> fish_color_quote 00
> fish_color_redirection 00afff
> fish_color_search_match --background=purple
> fish_color_selection --background=purple
> fish_color_status red
> fish_color_user green
> fish_color_valid_path --underline
> fish_greeting Welcome\ to\ fish,\ the\ friendly\ interactive\ shell\nType\
> \e\[32mhe…
> fish_key_bindings fish_default_key_bindings
> fish_pager_color_completion normal
> fish_pager_color_description '555'  'yellow'
> fish_pager_color_prefix cyan
> fish_pager_color_progress cyan
> fisher_active_prompt mono
> fisher_dependency_count 'git_util'  'pwd_is_home'  'pwd_info'
> 'host_info'  'last_job_id'  'humanize'…
>
>
>
> AND HERE IS FOR THE COMPUTER WHERE FISH SHELL USES COLORS
>
> __fish_init_1_50_0
> __fish_init_2_3_0
> fish_color_autosuggestion '555'  'yellow'
> fish_color_command '005fd7'  'purple'
> fish_color_comment red
> fish_color_cwd green
> fish_color_cwd_root red
> fish_color_end green
> fish_color_error 'red'  '--bold'
> fish_color_escape cyan
> fish_color_history_current cyan
> fish_color_host normal
> fish_color_match cyan
> fish_color_normal normal
> fish_color_operator cyan
> fish_color_param '00afff'  'cyan'
> fish_color_quote brown
> fish_color_redirection normal
> fish_color_search_match --background=purple
> fish_color_selection --background=purple
> fish_color_user green
> fish_color_valid_path --underline
> fish_greeting Welcome\ to\ fish,\ the\ friendly\ interactive\ shell\nType\
> \e\[32mhe…
> fish_key_bindings fish_default_key_bindings
> fish_pager_color_completion normal
> fish_pager_color_description '555'  'yellow'
> fish_pager_color_prefix cyan
> fish_pager_color_progress cyan
>
>
>
> > On Aug 1, 2016, at 8:36 PM, Kurtis Rader <kra...@skepticism.us> wrote:
> >
> > On Mon, Aug 1, 2016 at 5:06 PM, Pito Salas <pitosa...@gmail.com> wrote:
> > computer one: xterm 2.3.0
> > computer two: xterm 2.3.1
> >
> > If you run `set -U` on each system and compare the output are they truly
> the same? Also, "xterm" only supports eight colors. Fish has a heuristic to
> treat that as "xterm-256color" in certain situations but I don't recall off
> the top of my head if iTerm2 on macOS is one of them. In any case for the
> benefit of your other programs you should `set -gx TERM xterm-256color`.
> Try some controlled experiments such as
> >
> > echo (set_color -b white green)hello(set_color normal)
> >
> >  Do you see the same green text on a white background on both systems?
> >> On Aug 1, 2016, at 7:18 PM, Kurtis Rader <kra...@skepticism.us> wrote:
> >>
> >> What is $TERM $FISH_VERSION on each system?
> >>
> >> On Mon, Aug 1, 2016 at 3:10 PM, Pito Salas <pitosa...@gmail.com> wrote:
> >> I’ve been using Fish for a month now and loving it.
> >>
> >> I am using it on two computers.
> >>
> >> One one (mac air) the shell properly colors different syntactic
> elements just like the screenshots show on the site
> >>
> >> On the other, the shell displays white text on a black background.
> >>
> >> As far as I know I am using the exact same configuration
> >>
> >> In both cases I am using the latest version of iTerm2
> >>
> >> In both cases the same version of El Cap.
> >>
> >> I am not sure where to look to sort this out. The only reason it
> matters is if it’s an indication of some other more important problem.
> >>
> >> Thanks,
> >>
> >> Pito
> >>
> --
> >> ___
> >> Fish-users 

Re: [Fish-users] Default fish shell coloring not appearing

2016-08-01 Thread Kurtis Rader
On Mon, Aug 1, 2016 at 5:06 PM, Pito Salas <pitosa...@gmail.com> wrote:

> computer one: xterm 2.3.0
> computer two: xterm 2.3.1
>

If you run `set -U` on each system and compare the output are they truly
the same? Also, "xterm" only supports eight colors. Fish has a heuristic to
treat that as "xterm-256color" in certain situations but I don't recall off
the top of my head if iTerm2 on macOS is one of them. In any case for the
benefit of your other programs you should `set -gx TERM xterm-256color`.
Try some controlled experiments such as

echo (set_color -b white green)hello(set_color normal)

 Do you see the same green text on a white background on both systems?

> On Aug 1, 2016, at 7:18 PM, Kurtis Rader <kra...@skepticism.us> wrote:
>
> What is $TERM $FISH_VERSION on each system?
>
> On Mon, Aug 1, 2016 at 3:10 PM, Pito Salas <pitosa...@gmail.com> wrote:
>
>> I’ve been using Fish for a month now and loving it.
>>
>> I am using it on two computers.
>>
>> One one (mac air) the shell properly colors different syntactic elements
>> just like the screenshots show on the site
>>
>> On the other, the shell displays white text on a black background.
>>
>> As far as I know I am using the exact same configuration
>>
>> In both cases I am using the latest version of iTerm2
>>
>> In both cases the same version of El Cap.
>>
>> I am not sure where to look to sort this out. The only reason it matters
>> is if it’s an indication of some other more important problem.
>>
>> Thanks,
>>
>> Pito
>>
>> ------
>> ___
>> Fish-users mailing list
>> Fish-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/fish-users
>>
>
>
>
> --
> Kurtis Rader
> Caretaker of the exceptional canines Junior and Hank
>
>
>


-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Default fish shell coloring not appearing

2016-08-01 Thread Kurtis Rader
What is $TERM $FISH_VERSION on each system?

On Mon, Aug 1, 2016 at 3:10 PM, Pito Salas <pitosa...@gmail.com> wrote:

> I’ve been using Fish for a month now and loving it.
>
> I am using it on two computers.
>
> One one (mac air) the shell properly colors different syntactic elements
> just like the screenshots show on the site
>
> On the other, the shell displays white text on a black background.
>
> As far as I know I am using the exact same configuration
>
> In both cases I am using the latest version of iTerm2
>
> In both cases the same version of El Cap.
>
> I am not sure where to look to sort this out. The only reason it matters
> is if it’s an indication of some other more important problem.
>
> Thanks,
>
> Pito
>
> --
> ___
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>



-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] SELinux and Fish?

2016-07-31 Thread Kurtis Rader
On Sun, Jul 31, 2016 at 7:15 PM, John Chludzinski <
john.chludzin...@gmail.com> wrote:

> Are there any issues with Fish in connection with SELinux that anyone's
> aware of?
>

The only relevant issue is
https://github.com/fish-shell/fish-shell/issues/63 which talks about
installing it from source and is closed.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] How to avoid printing $fish_greeting before the "read" command prompt

2016-07-23 Thread Kurtis Rader
On Sat, Jul 23, 2016 at 9:32 PM, Andrew Toskin <summerfallsa...@gmail.com>
wrote:

> > echo "$FISH_VERSION"
> 2.3.1
>
> An example script, which always prints fish_greeting when I execute it:
>
> #!/usr/bin/fish
> echo "What's your name?"
> read name
> echo "Hello, $name!"
>

Yes, that is definitely a bug. I'm surprised there isn't an open issue
about this. The problem is that the prompt issued by the `read` command is
considered the equivalent of an interactive command prompt and thus
triggers running the fish_greeting code. Please open an issue at
https://github.com/fish-shell/fish-shell/issues/new

P.S., I suspect no one has reported this because most fish users (certainly
the core developers) inhibit that greeting via

function fish_greeting; end

or

set -g fish_greeting ''

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] How to avoid printing $fish_greeting before the "read" command prompt

2016-07-23 Thread Kurtis Rader
On Sat, Jul 23, 2016 at 8:19 PM, Andrew Toskin <summerfallsa...@gmail.com>
wrote:

> I'm using fish 2.3.1, in GNOME Terminal 3.20.2, on Fedora 24 (64-bit).
>
> I'm writing a simple script that uses the read command to get info from
> the user before continuing. Every time the script runs, when it gets to the
> first "read" line, it prints the "$fish_greeting" variable, which I find
> a little distracting.
>
> I do not have this issue with another, much more complicated script I
> wrote, perhaps because all the read commands are in excessively deeply
> nested switch cases and conditionals...
>
> For my simple script, the only workaround I've been able to figure out is
> to set fish_greeting to an empty string -- however, even when I use set
> --local, that seems to permanently remove the fish greeting for all
> future sessions, not just when running the script. Some users of my script
> may not like that. Is this a bug in fish? Is there another way to avoid
> print the fish_greeting in a script?
>

it might be a bug in fish but that seems unlikely if you're running a
recent fish version. The fish_greeting is only shown when a new interactive
shell is started just before the first prompt is displayed. Can you provide
a script that would allow someone else to recreate the problem? Also, what
does "echo $FISH_VERSION" output? if you're running a fish version older
than 2.3.0 I'd want to know if you can reproduce the problem with 2.3.0 or
2.3.1.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] accessing fish environment variables from C or other languages

2016-07-18 Thread Kurtis Rader
On Mon, Jul 18, 2016 at 4:37 PM, Patrick <patr...@spellingbeewinnars.org>
wrote:

> What I would like to do, is to write a fish script that ran a bunch of
> commands returning the values in environment variables. I would then
> like to access those variables from C( actually COBOL).
>
> I know this can be done with bash but is there a way to do it with fish ?
>
> The standard libraries will assume bash not fish.
>

It is not clear what you're trying to do. In the UNIX process model
environment variables are passed from the parent process to its child
processes. A child process cannot directly modify the environment vars of
its parent process. The only way to do so is via a cooperative strategy.
For example, the child process could write each env var to stdout in the
form "name=value\n" (you'll need to figure out how to encode newlines in
the value to make this bullet proof).  The parent process would then create
a pipe and attach the stdout of the child process to one end of the pipe.
The parent process then reads the "name=value" lines from the other end of
the pipe and does whatever it wants with those env vars -- including
self-modifying its own set of env vars. In C you would do that with the
`putenv()` or `setenv()` functions.

Note that your problem statement, as written, is not unique to the fish
shell. The answer would be the same if you used bash or zsh.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


[Fish-users] do you use `history --delete`?

2016-07-15 Thread Kurtis Rader
if you use the `history --delete` command please read
https://github.com/fish-shell/fish-shell/issues/3242 and comment on the
proposal to remove the (broken) ability to delete individual entries.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] compare version strings

2016-07-08 Thread Kurtis Rader
On Fri, Jul 8, 2016 at 2:09 PM, Andrew Schulman <and...@utexas.edu> wrote:

> What's the best (simplest, most efficient, or however) way to compare two
> version strings in fish?  Any better way than writing a custom function?
>
> For example, I want to test if the current running version of fish is less
> than
> 2.3.1.  I want to compare $FISH_VERSION to 2.3.1, using the version
> component
> ordering.
>
> I looked around for builtins or standard commands for this and I didn't
> find
> any.
>

The only stock script which does anything like that is help.fish and what
it does isn't really what you're looking for. Using the new "string"
builtin:

set -l fish_version (echo $FISH_VERSION | string split '.')

Then $fish_version[1] is the major number, $fish_version[2] the minor, etc.
If you need the solution to work on fish versions older than 2.3.0 (which
don't have the string builtin) you'll need to do it the hard way:

set -l fish_version
for i in 1 2 3
set fish_version[$i] (echo 2.3.1 | cut -d . -f $i)
end




-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] About funced

2016-06-28 Thread Kurtis Rader
On Tue, Jun 28, 2016 at 2:24 PM, Pito Salas <pitosa...@gmail.com> wrote:

> I guess one question is, does it matter if the syntax of the text I write
> in the editor is correct?
>
> And related, am I writing a function body or a whole function? And if the
> names don’t match?
>

You're writing a whole function. If you run "funced" with a function name
not already defined it should open your editor with an empty function
template; e.g., running "funced abc" puts me in the editor with this
content:

function abc

end


> Here’s what I am adding to the text editor:
>
> function myfunc
> echo “hello world”
> end
>

Did you run "funced myfunc"?


> Another observation, the command “funced myfunc” returns right away, and
> only 1/2 second later does Atom’s window open. Is that a clue?
>

You need to configure your editor to stay in the foreground. For example,
when using the Vim GUI via "vim -g" or "gvim" you also need the "-f" flag
to keep it in the foreground.

Also, as others have pointed out, you need to run "funcsave" if you want
your edited function to be saved to your ~/.config/fish/functions directory
so it is available to other fish sessions.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] echo -ne?

2016-06-27 Thread Kurtis Rader
On Mon, Jun 27, 2016 at 6:20 PM, Pito Salas <pitosa...@gmail.com> wrote:

> Is there a way to get the equivalent behavior of *echo -ne* in Fish?
>
> Here’s an example:
>
> echo -ne "\033];${PWD##*/}\007”
>

"echo -ne" works just fine in fish. But the variable syntax you're using is
not. In fish you would traditionally do

set -l base_pwd (basename $PWD)
echo -ne "\033];$base_pwd\007"

As of fish 2.3.0 you could also use the new "string" builtin.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Newbie: overriding and using "built in functions" such as prompt_pwd and _fish_git_prompt

2016-06-27 Thread Kurtis Rader
>
> On my computer fish_config doesn’t seem to work. First of all the
> “current” theme that the web page show does not look like it looks in
> iTerm2. And if I pick a different theme, , and set it, and then press
>  in the shell, no change.


How does it look different? Is the background color different? If so that's
to be expected. Fish as no way of determining (at least in a portable
fashion) what the background color your shell is using. That's why in the
upper right corner is a small palette of colors you can chose to see how
the theme looks with different background colors.

As for it not changing the theme in your shell that suggests you may be
using a plugin manager or have otherwise set your theme in a manner
incompatible with the fish web UI.

Regarding the fish_prompt.fish, you are simply overriding the one that is
> found in share/functions. Is there a way to call the “original” one in that
> scenario?


Yes, I'm simply overriding the default. You can't call the original (i.e.,
default) function because it has the same name and fish, like every other
shell, has no concept of namespaces. If you look at the default
fish_prompt.fish script you'll see that it constructs the prompt by calling
other functions. You may find that simply overriding one or more of those
functions is preferable to reimplementing the fish_prompt function. That
has the advantage that your changes are more likely to be used by prompts
from other themes since they all tend to call those functions.

In a related question, if I make a function called e.g. “cd” how do I call
> the actual underlying cd command?


By prefacing it with "builtin". Similarly, if you define a function with
the same name as an external command you want to run you preface that with
"command". Also, as of the 2.3.0 release you need to use the
"--shadow-builtin" flag to indicate you know that you're overriding a
builtin command.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


  1   2   >