Skip to content

While starting nu the config.nu doesn't seem to be able to source any relative files. #7849

@TheCodeLamp

Description

@TheCodeLamp

Describe the bug

I like keeping my config files a bit organized so I tried making a separate completions.nu file where I could source all my external completions. However there is a problem when starting nu fresh; the config.nu file cant seem to see it's neighboring files.

Screenshot from 2023-01-24 10-38-41

However when I source the full path name it seems to work fine with no errors.

Screenshot from 2023-01-24 10-43-05

This seems to only be a problem in the config.nu file as the completions.nu can seem to load the other completions files and even source a test file I created to get confirmation of nested sourcing.

# completions.nu
# Script for gathering all completion files.

export use cargo-completions.nu *
export use git-completions.nu *

source confirm-test-load.nu # Added as a test to see if nested sourcing works.

"Completions Loaded" # Added as a test to see confirmation.

How to reproduce

  1. create config.nu and completions.nu in ~/.config/nushell/
  2. add source completions.nu or use completions.nu to config.nu

Expected behavior

I expect nu to load the relative files without having to use the full file path.

Screenshots

No response

Configuration

key value
version 0.74.0
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.66.0 (69f9c33d7 2022-12-12)
rust_channel stable-x86_64-unknown-linux-gnu
cargo_version cargo 1.66.0 (d65d197ad 2022-11-15)
pkg_version 0.74.0
build_time 2023-01-23 13:06:35 +01:00
build_rust_channel release
features database, dataframe, default, trash, which, zip
installed_plugins

Additional context

I am using Fedora and I've tried this in semode permissive.

I've tried installing the bin to /usr/local/bin/ but the problem persists.

Some relevant issues:
#6150
#7247

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions