owned this note changed 4 months ago
Published Linked with GitHub

Nushell core team meeting 2024-11-20

Attendees

  • Jack
  • Stefan
  • Darren
  • Michael
  • Ian
  • Doug
  • Devyn
  • Wind
  • Rose
  • Jakub
  • vishal
  • piepmatz
  • Antoine
  • Maxim

Agenda

  • From last weeks agenda : Clarify when config is allowed to alter runtime behavior, if at all #14331.
    • Darren would like to revert #13875 in favor of 14331 when the PR is finished. It would be nice to have ls always sort in a configured manner and none of the ls-shadowing scripts work well enough.
    • Doug pointed out that the pipeline metadata could be inspected to check if the source is ls, and then a sort could be applied in the display hook. One downside is that ls | get will display a different order (Rose).
    • A custom command, although verbose, can cover this use case (Ian). There might be a bug with globs, but otherwise it can achieve the same result.
  • Running ps files #13020
    • Followup to change the script launch behavior to use bash/powershell semantics of executable scripts have to be called either with a path ./script or on PATH
  • Standardizing hooks #14345
    • Change most hooks to lists to make sharing scripts easier. No need to check if null, a single hook, or a list.
    • Hook lists are run in order and have no return value but can print to the screen.
    • Hooks that return a value (display_output and command_not_found) must be a single hook.
  • Concat operator #14344

Add these last two items for next weeks agenda

  • Add parse-time constant $current_file #14305 vs Add path const command for getting absolute paths to files at parse time #14303
  • Special interest groups, mini teams: getting the expertise to the issues.

Discussed Topics

Prelude: Vi mode in reedline

sneaked in: config simplification

Let's GO!

#14331 (Jakub's attmept):

def lss [--all(-a), ...p: glob] {
    let p = if ($p | is-empty) { [.] } else { $p }    
    ls ...$p --all=$all | sort-by size
}

#14331 (Ian's attempt):
Darren is running this (added the aliases at the bottom)

def lss [
    --all (-a),         # Show hidden files
    --long (-l),        # Get all available columns for each entry (slower; columns are platform-dependent)
    --short-names (-s), # Only print the file names, and not the path
    --full-paths (-f),  # display paths as absolute paths
    --du (-d),          # Display the apparent directory size ("disk usage") in place of the directory metadata size
    --directory (-D),   # List the specified directory itself instead of its contents
    --mime-type (-m),   # Show mime-type in type column instead of 'file' (based on filenames only; files' contents are not examined)
    --threads (-t),     # Use multiple threads to list contents. Output will be non-deterministic.
    ...pattern: glob,   # The glob pattern to use.
]: [ nothing -> table ] {
    let pattern = if ($pattern | is-empty) { [ '.' ] } else { $pattern }
    (ls
        --all=$all
        --long=$long
        --short-names=$short_names
        --full-paths=$full_paths
        --du=$du
        --directory=$directory
        --mime-type=$mime_type
        --threads=$threads
        ...$pattern
    ) | sort-by type name -i
}

alias ls-builtin = ls
alias ls = lss

#14344 (Jakub's cute idea):

[a b] <+ [c d]  # [a b [c d]]
[a b] +> [c d]  # [[a b] c d]
[a b] ++ [c d]  # [a b c d]
[a b] <+ c      # [a b c]
Select a repo