FG
💻 Software

Invoking vi through find | xargs breaks my terminal. Why?

Fresh5 days ago
Mar 15, 202629984 views
Confidence Score1%
1%

Problem

When invoking through , like this: you get a warning about and a terminal with pretty much broken behaviour afterwards. Why is that? This question was explicitly about the why, not about the how to avoid. This was asked, and answered, elsewhere.

Error Output

find . -name "*.txt" | xargs vim

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Invoking vi through find | xargs breaks my terminal. Why?

Low Risk

(Following on from grawity's explanation, that points to .) The solution for this problem is to add the parameter to . From : Reopen stdin as in the child process before executing the command. This is useful if you want to run an interactive application. Thus, the following line of code should work for you: GNU xargs supports this extension since some release in 2017 (with the long option name ). For older or other versions of xargs, you can explicitly pass in to solve the problem: (The is ther…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment