Console icon indicating copy to clipboard operation
Console copied to clipboard

Detect when we are running in screen

Open jubianchi opened this issue 9 years ago • 8 comments

I don't actually know if screen may cause similar bugs as tmux but perhaps it might be useful to check if we are running in it.

Just like we did for tmux with Console::isTmuxRunning I think we should introduce Console::isScreenRunning.

Even if adapting escape sequences is not required when we are in screen I think this method will still be useful for developers to know from their code if the users is inside a multiplexer.

See here for the original discussion: https://github.com/hoaproject/Console/pull/53#issuecomment-144386528


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

jubianchi avatar Oct 06 '15 22:10 jubianchi

Why not checking Console::isMultiplexerRunning ? I don't think implementing a method for each multiplexer is the good way to do that.

Jir4 avatar Oct 07 '15 06:10 Jir4

@Jir4 Correct but we have to deal with each multiplexer… So maybe we should go for Console::isMultiplexerRunning and Console::getMultiplexerName? That's a strange API too…

Thoughts?

Hywan avatar Oct 07 '15 07:10 Hywan

@Hywan Is it the name really important ? Does something change for each multiplexer ( when we copy for instance ) ?

I don't see all impacts of multiplexers on Hoa\Console

Jir4 avatar Oct 07 '15 07:10 Jir4

@Jir4 @Hywan I would go for something like Console::isRunningInsideMultiplexer which would just be an helper method for developers using Hoa/Console:

public function isRunningInsideMultiplexer() {
    return static::isTmuxRunning() || static::isScreenRunning();
}

This would ease the use of this check but still allow us to do isolated internal checks.

jubianchi avatar Oct 07 '15 07:10 jubianchi

:+1:

Jir4 avatar Oct 07 '15 08:10 Jir4

:+1:

Hywan avatar Oct 13 '15 04:10 Hywan

Do we agree that this is for private usages, while the visibility will be public I guess.

Hywan avatar Oct 13 '15 04:10 Hywan

Any PR?

Hywan avatar Feb 21 '17 08:02 Hywan