Skip to content

commands gets executed even though separated by a semicolon. #7653

Closed

Description

@TornaxO7

Describe the bug

If I use my given alias below then it gets completely executed although there's a semicolon between the commands.

How to reproduce

  1. In your REPL run the following:
alias test = some_sus_command; print "yes"
  1. Then you will see first, that it gets executed (for whatever reason)
  2. Type test and you'll see that yes is printed out, although some_sus_command hasn't been defined yet.

Expected behavior

That print "yes" does not get executed.

Screenshots

No response

Configuration

key value
version 0.73.0
branch makepkg
commit_hash 1291b64
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.66.0 (69f9c33d7 2022-12-12) (Arch Linux rust 1:1.66.0-1)
cargo_version cargo 1.66.0
pkg_version 0.73.0
build_time 2022-12-21 00:14:26 +00:00
build_rust_channel release
features database, dataframe, default, trash, which, zip
installed_plugins

Additional context

No response

Activity

  1. added
    category:bug
    on Jan 1, 2023
  2. rgwood commented on Jan 1, 2023

    @rgwood
    Contributor

    Thanks for the issue! I can reproduce this:

    〉let f = (^false; "foo")
    〉$f
    foo
    key value
    version 0.73.1
    branch main
    commit_hash e56c01d
    build_os linux-x86_64
    build_target x86_64-unknown-linux-gnu
    rust_version rustc 1.65.0 (897e37553 2022-11-02)
    rust_channel 1.65.0-x86_64-unknown-linux-gnu
    cargo_version cargo 1.65.0 (4bc8f24d3 2022-10-20)
    pkg_version 0.73.1
    build_time 2022-12-31 18:09:02 -08:00
    build_rust_channel release
    features database, default, trash, which, zip
    installed_plugins
  3. added
    A:error-handling
    on Jan 1, 2023
  4. Kangaxx-0 commented on Jan 3, 2023

    @Kangaxx-0
    Contributor

    Regards to alias test = some_sus_command; print "yes" , I was not able to reproduce it against latest main branch, I did not see yes

    image

    For @rgwood 's code, I believe subexpression does not early returns because we do not check if external fails or not inside iteration ?

        for pipeline in block.pipelines.iter() {
            for expr in pipeline.elements.iter() {
                input = eval_element_with_input(engine_state, stack, expr, input, true, false)?.0
            }
        }
    
    
  5. fdncred commented on Dec 5, 2023

    @fdncred
    Contributor

    should this be closed due to #8984?

  6. TornaxO7 commented on Dec 5, 2023

    @TornaxO7
    ContributorAuthor

    I can close this for the time being since I haven't switched to nushell yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:error-handlingcategory:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions