tmux-plugins / tmux-resurrect

Persists tmux environment across system restarts.
MIT License
11.42k stars 424 forks source link

Is it possible to restore a program piped to another program i.e. | grep #433

Open ioogithub opened 2 years ago

ioogithub commented 2 years ago

I have been trying to get this to restore without success:

journalctl -f | grep -E 'error|failure'

I.e. one program piping data to another program.

In this example I have both journalctl and grep as apps to restore in "set -g @resurrect-processes"

I have tried adding ~ and -> and some of the other examples here: https://github.com/tmux-plugins/tmux-resurrect/blob/master/docs/restoring_programs.md

but nothing works. Is this possible?

Hologos commented 2 years ago

Setup your env manually, invoke resurrect-save and post content of last file here, I'll try to help.

ioogithub commented 2 years ago

Thanks, I have spent quite a bit of time trying to find a solution with trial and error without success.

Here is the command I am trying to run that I would like resurrected:

journalctl -f | grep -E 'error|failure'

Here is how it appears in last:

journalctl      :journalctl -f
grep --color=auto -E error|failure

Note: the ' ' characters and the grep command have been removed

Here is how it is restored:

journalctl -f

So everything after the pipe | has not been restored.

I have tried a series of ~, -> and "" attempts without success.

I actually have several piped commands I would like to restore and they all have the same issue, they only restore until the | character. Do I need to escape the | character somehow or is it not possible to restore two commands that are piped in this way?

DeusProx commented 1 year ago

Is there an update on this? I also would like to resurrect some pipes? Especially the journal command with the grep is my exact usecase. I just want a tmux session which some processes watching my system.

ioogithub commented 1 year ago

It's a bug, it will restore the command up until the | character which means that it doesn't work.

I doubt it will be fixed as this project appears to be abandoned. There are much worse issues that I found a year ago that make the app very frustrating that had not been addressed either.

I tried to use tmux to setup a dashboard with different panes monitoring different part of the system but I was not successful because when the server is restarted everything is lost. I have been looking for other solutions.

Its too bad such an awesome idea with such great potential.