nushell icon indicating copy to clipboard operation
nushell copied to clipboard

external commands get formatted tables

Open estokes opened this issue 3 years ago • 3 comments

Describe the bug

consider the pipeline,

ps | each {$"/local/ps/($in.name)|u64|($in.pid)"} | ^cat

One would expect cat to receive lines in the form

/local/ps/{name-of-process}|u64|{pid-of-process}

Instead, nushell formats the table as if it was going to show it to a human, and then sends it on to cat. E.G.

/home/eric/proj/demoscene/views〉ps | each {$"/local/ps/($in.name)|u64|($in.pid)"} | ^head
╭─────┬──────────────────────────────────────────────────────────────────────╮
│   0 │ /local/ps//usr/lib/systemd/systemd|u64|1                             │
│   1 │ /local/ps/kthreadd|u64|2                                             │
│   2 │ /local/ps/rcu_gp|u64|3                                               │
│   3 │ /local/ps/rcu_par_gp|u64|4                                           │
│   4 │ /local/ps/netns|u64|5                                                │
│   5 │ /local/ps/kworker/0:0H-events_highpri|u64|7                          │
│   6 │ /local/ps/mm_percpu_wq|u64|9                                         │
│   7 │ /local/ps/rcu_tasks_kthread|u64|10                                   │
│   8 │ /local/ps/rcu_tasks_rude_kthread|u64|11                              │

This is pretty much entirely useless for interacting with any external command I can think of.

How to reproduce

  1. pipe anything non trivial to an external command

Expected behavior

For a simple list of strings I expect each string to be sent to the external command as 1 line. To be honest, given that primitive, and the already ample string manipulation functions in nushell, you should be able to do most anything.

Screenshots

No response

Configuration

No response

Additional context

No response

estokes avatar May 22 '22 16:05 estokes

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @backstage/plugin-search

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/plugin-search plugins/search none v1.4.6-next.3

backstage-goalie[bot] avatar Feb 15 '24 15:02 backstage-goalie[bot]

Uffizzi Ephemeral Environment - Virtual Cluster

Your cluster pr-22985 was successfully created. Learn more about Uffizzi virtual clusters To connect to this cluster, follow these steps:

  1. Download and install the Uffizzi CLI from https://docs.uffizzi.com/install
  2. Login to Uffizzi, then select the backstage account and project:
uffizzi login
Select an account: 
  ‣ backstage
    jdoe

Select a project or create a new project: 
  ‣ backstage-6783521
  1. Update your kubeconfig: uffizzi cluster update-kubeconfig pr-22985 --kubeconfig=[PATH_TO_KUBECONFIG] After updating your kubeconfig, you can manage your cluster with kubectl, kustomize, helm, and other tools that use kubeconfig files: kubectl get namespace --kubeconfig [PATH_TO_KUBECONFIG]

Access the backstage endpoint at https://backstage-default-pr-22985-c3595.uclusters.app.uffizzi.com

github-actions[bot] avatar Feb 15 '24 15:02 github-actions[bot]

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Feb 22 '24 15:02 github-actions[bot]

Oh sorry - could you make a changeset (yarn changeset) on a patch level so that this gets shipped as well?

freben avatar Feb 26 '24 12:02 freben

Can you please explain more what should i change

MeenuyD avatar Feb 26 '24 14:02 MeenuyD

Run the command yarn changeset as described above and follow the instructions, and commit the created file with this PR.

freben avatar Feb 26 '24 14:02 freben

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Mar 04 '24 14:03 github-actions[bot]