GithubHelp home page GithubHelp logo

Comments (18)

derekstavis avatar derekstavis commented on May 26, 2024

What's your fish version? fish --version?

from oh-my-fish.

maxzinkus avatar maxzinkus commented on May 26, 2024

2.1.1
Let me know what environment info you need to debug, thanks!

from oh-my-fish.

derekstavis avatar derekstavis commented on May 26, 2024

I would like to understand why function -V isn't working for you. What does function --help outputs to you?

from oh-my-fish.

maxzinkus avatar maxzinkus commented on May 26, 2024

function, with any flags or none, followed by a newline, sets about 8
spaces (maybe a tab?) into my shell and doesn't do anything or give any
indication of error.

Subsequent characters including newline appear at that offset. This
continues until a Ctrl-c is used to clear the line.

No new prompt is printed, as if I'd never submitted function as a command.

echo (function)

Prints
"fish: Could not locate end of block. The "end" command is missing,
misspelled or a ";" is missing."

Without the outermost quotes, and that command stays in the line despite
the newline.

It's definitely weird, seems like a syntax error in the "function"
definition maybe?

Thanks,
Max
On Oct 31, 2015 3:55 PM, "Derek Willian Stavis" [email protected]
wrote:

I would like to understand why function -V isn't working for you. What
does function --help outputs to you?


Reply to this email directly or view it on GitHub
#147 (comment)
.

from oh-my-fish.

derekstavis avatar derekstavis commented on May 26, 2024

Don't worry, what you described is what should happen. I wanted to know the output of function --help to check if it supports -V, but your fish version confirms it does.

from oh-my-fish.

derekstavis avatar derekstavis commented on May 26, 2024

Another question: Could you try again omf update after reloading your shell? Does it work?

from oh-my-fish.

NoraCodes avatar NoraCodes commented on May 26, 2024

This is happening for me as well, on Ubuntu GNOME 15.04. https://asciinema.org/a/ao9dnlxme55rkyxwapbdkqb47

from oh-my-fish.

derekstavis avatar derekstavis commented on May 26, 2024

Can you please paste me the output of this:

set my_var "aaaa"
function -V my_var test_function
  echo $my_var
end

test_function

set my_var
function -V my_var test_function
  echo $my_var
end

test_function

PS: Thanks for the asciinema, very useful!!

from oh-my-fish.

NoraCodes avatar NoraCodes commented on May 26, 2024

I love asciinema, it's pretty great.
http://asciinema.org/a/1qkpb86byyy53w7zxjn8yzoqr

from oh-my-fish.

maxzinkus avatar maxzinkus commented on May 26, 2024

With the indentation behaviour I mentioned, it simply outputs an error

function: Unknown option "my_var" Current functions are: . N_ alias autoload ...snip...

On Nov 4, 2015 1:04 PM, "Derek Willian Stavis" [email protected]
wrote:

Can you please paste me the output of this:

set my_var "aaaa"function -V my_var test_function
echo $my_varend
set my_varfunction -V my_var test_function
echo $my_varend


Reply to this email directly or view it on GitHub
#147 (comment)
.

from oh-my-fish.

derekstavis avatar derekstavis commented on May 26, 2024

It looks to me that you happen to be using a very old version of fish, which does not support arguments to function built in.

from oh-my-fish.

NoraCodes avatar NoraCodes commented on May 26, 2024

It's the Ubuntu repo version, I'll file a bug over there. Thanks.

from oh-my-fish.

derekstavis avatar derekstavis commented on May 26, 2024

The output of function --help should look like the one below, which includes ‐V. I'm currently using fish 2.2.0.

⋊> ~/.l/s/omf on master ○ function --help

       function ‐‐ create a function

   Synopsis
       function [OPTIONS] NAME; BODY; end

   Description
       function creates a new function NAME with the body BODY.

       A function is a list of commands that will be executed when the name of the function is given as a
       command.

       The following options are available:

       · ‐a NAMES or ‐‐argument‐names NAMES assigns the value of successive command‐line arguments to the names
         given in NAMES.

---------------------------------- lots of other options ----------------------------------

       · ‐V or ‐‐inherit‐variable NAME snapshots the value of the variable NAME and defines a local variable
         with that same name and value when the function is executed.

from oh-my-fish.

maxzinkus avatar maxzinkus commented on May 26, 2024

The version is >= 2, I would track down the bug but unfortunately I have no
time.

If it persists over the next update I'll do the deep dive to find it.

Thanks!
On Nov 4, 2015 4:56 PM, "Derek Willian Stavis" [email protected]
wrote:

The output of function --help should look like the one below, which
includes ‐V. I'm currently using fish 2.2.0.

⋊> ~/.l/s/omf on master ○ function --help

   function ‐‐ create a function

Synopsis
function [OPTIONS] NAME; BODY; end

Description
function creates a new function NAME with the body BODY.

   A function is a list of commands that will be executed when the name of the function is given as a
   command.

   The following options are available:

   · ‐a NAMES or ‐‐argument‐names NAMES assigns the value of successive command‐line arguments to the names
     given in NAMES.

   · ‐d DESCRIPTION or ‐‐description=DESCRIPTION is a description of what the function does, suitable as a
     completion description.

   · ‐w WRAPPED_COMMAND or ‐‐wraps=WRAPPED_COMMAND causes the function to inherit completions from the
     given wrapped command. See the documentation for complete for more information.

   · ‐e or ‐‐on‐event EVENT_NAME tells fish to run this function when the specified named event is emitted.
     Fish internally generates named events e.g. when showing the prompt.

   · ‐v or ‐‐on‐variable VARIABLE_NAME tells fish to run this function when the variable VARIABLE_NAME
     changes value.

   · ‐j PGID or ‐‐on‐job‐exit PGID tells fish to run this function when the job with group ID PGID exits.
     Instead of PGID, the string ’caller’ can be specified. This is only legal when in a command
     substitution, and will result in the handler being triggered by the exit of the job which created this
     command substitution.

   · ‐p PID or ‐‐on‐process‐exit PID tells fish to run this function when the fish child process with
     process ID PID exits.

   · ‐s or ‐‐on‐signal SIGSPEC tells fish to run this function when the signal SIGSPEC is delivered.
     SIGSPEC can be a signal number, or the signal name, such as SIGHUP (or just HUP).

   · ‐S or ‐‐no‐scope‐shadowing allows the function to access the variables of calling functions. Normally,
     any variables inside the function that have the same name as variables from the calling function are
     ’shadowed’, and their contents is independent of the calling function.

   · ‐V or ‐‐inherit‐variable NAME snapshots the value of the variable NAME and defines a local variable
     with that same name and value when the function is executed.


Reply to this email directly or view it on GitHub
#147 (comment)
.

from oh-my-fish.

mdiluz avatar mdiluz commented on May 26, 2024

If it helps - I'm experiencing this as well with

> fish --version
fish, version 2.1.1

On Fedora 21 using the default repo version of fish

from oh-my-fish.

maxzinkus avatar maxzinkus commented on May 26, 2024

Okay so it seems the issue is that Fedora (and Ubuntu, apparently) is distributing an outdated fish as 2.1.1.

This is odd.. What's the resolution process on that?

from oh-my-fish.

derekstavis avatar derekstavis commented on May 26, 2024

Yeah, this is the only explanation for the issue. I would recommend you trying to use official fish package distribution: http://software.opensuse.org/download.html?project=shells%3Afish%3Arelease%3A2&package=fish

from oh-my-fish.

maxzinkus avatar maxzinkus commented on May 26, 2024

Aha, the issue was a problem with my system configuration interacting with the yum repos.
Thanks for the support, I apologize for any wild goose chase this may have caused.

To those with this problem, make sure the repo.xml.key has been imported to GPG so that fish can receive updates.

Thanks again!

from oh-my-fish.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.