Comments (6)
Thanks for the repro. I can reproduce the problem, and it definitely looks like nodemon
is trying to read user input. So nodemon
and fzf
are both competing to read from /dev/tty
at the same time, and it causes the problems.
Workaround 1. Prevent nodemon from reading user input
By redirecting /dev/null
to its standard input.
node_modules/nodemon/bin/nodemon.js index.js < /dev/null | fzf --ansi --tail 10000 --tac
The problem is nodemon
doesn't terminate after fzf exits.
Workaround 2. Make fzf start the process
fzf --ansi --tail 10000 --tac --bind 'start:reload:node_modules/nodemon/bin/nodemon.js index.js'
fzf starts nodemon process when it starts, and can terminate it when it exits.
(Works better with 5b52833)
from fzf.
Does node_modules/.bin/ts-node src/index.ts
take user input from keyboard?
fzf crashes
Are there any error messages?
from fzf.
Does node_modules/.bin/ts-node src/index.ts take user input from keyboard?
No.
Are there any error messages?
No. So, at a loss what to do to debug. I could run the GitHub version again if there's a way to enable logging somewhere.
from fzf.
Can you provide minimal steps to reproduce the problem from my side? I don't have your project with index.ts so there's no way I can further look into the problem. Also, please don't assume that I know anything about the thing called "ts-node".
from fzf.
Ah, sorry, I was hoping to look for a way to get debug logs so I can gather more information first. Thanks for helping to look into this.
I was wrong, it wasn't ts-node
, but nodemon which reproduces the issue. From the tool's README:
Monitor for any changes in your node.js application and automatically restart the server - perfect for development
I made a repo to reproduce the issue for me — https://github.com/hboon/nodemon-fzf/. It's really just running nodemon
or a single source file that logs 1 line to STDOUT. There are 2 branches. (B) should be easier to get started (but trust…).
A. main
— you will need to have pnpm
installed and run pnpm i
first to install the nodemon
that is causing this)
B. with-node-modules
— this includes nodemon
already so you can skip (A), and don't need to install pnpm
Run this:
node_modules/nodemon/bin/nodemon.js index.js | fzf
index.js
only logs a line to STDOUT so I suppose it's the way nodemon
works that's causing an issue?
I'm hoping to use fzf
for streaming server logs during development.
from fzf.
Both workarounds work for me. I'll use (2). Doesn't seem like 5b52833 is needed yet.
But all good. Thanks again!
from fzf.
Related Issues (20)
- Replacing placeholder by the query when no match HOT 2
- Using bind with an echo output, the variable assignment no longer works HOT 2
- Question: What's the expected behavior with --nth and --with-nth together? HOT 2
- Manually triggering events HOT 1
- Allow pointer to be disabled HOT 4
- FZF_DEFAULT_OPTS is broken on OSX, installing via brew or git clone HOT 1
- [BUG] Multi-line commands surrounded by parentheses not showing up in history HOT 2
- Allow CTRL-C to cancel transform actions
- fzf-completion doesn't work on fresh archlinux install HOT 8
- --marker '═' --marker-multi-line '╔║╚' does not take effect? HOT 1
- "panic: runtime error" if tty is 1 line high HOT 1
- panic: runtime error: invalid memory address or nil pointer dereference HOT 21
- fzf `CTRL+R` only working in zsh `vicmd` mode HOT 1
- Running `fzf -f whatever` with an `i3` keybinding fails HOT 1
- Re-evaluate --bind each time bindkey pressed HOT 1
- Select candidate if it's multi lines? HOT 1
- Option to show --marker and --marker-multi-line if it's multi lines? HOT 1
- Constraint to only exit fzf if processes base on key press are done? HOT 6
- History search not working HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fzf.