krasa / GrepConsole

IntelliJ plugin - https://plugins.jetbrains.com/plugin/7125
Apache License 2.0
437 stars 57 forks source link

[Bug] Tailing a named pipe on Linux throws an Exception #135

Closed HappyHamster closed 5 years ago

HappyHamster commented 5 years ago

I guess can be considered a bug, because named pipes are supposed to behave like ordinary files (more-or-less) and thus software that works with files is expected to work with named pipes (more-or-less :) ). Currently if I try to tail a pipe I get this:

java.lang.RuntimeException: java.io.IOException: Illegal seek
    at krasa.grepconsole.action.OpenFileInConsoleAction$MyProcess.<init>(OpenFileInConsoleAction.java:121)
    at krasa.grepconsole.action.OpenFileInConsoleAction$MyProcess.<init>(OpenFileInConsoleAction.java:114)
    at krasa.grepconsole.action.OpenFileInConsoleAction.openFileInConsole(OpenFileInConsoleAction.java:53)
    at krasa.grepconsole.action.OpenFileInConsoleAction.actionPerformed(OpenFileInConsoleAction.java:45)
    at krasa.grepconsole.action.OpenFileInConsoleToolbarAction$1.mousePressed(OpenFileInConsoleToolbarAction.java:32)
    at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:279)
    at java.awt.Component.processMouseEvent(Component.java:6545)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3325)
    at java.awt.Component.processEvent(Component.java:6313)
    at java.awt.Container.processEvent(Container.java:2237)
    at java.awt.Component.dispatchEventImpl(Component.java:4903)
    at java.awt.Container.dispatchEventImpl(Container.java:2295)
    at java.awt.Component.dispatchEvent(Component.java:4725)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4523)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
    at java.awt.Container.dispatchEventImpl(Container.java:2281)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4725)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:737)
    at java.awt.EventQueue$4.run(EventQueue.java:735)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:719)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:664)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.io.IOException: Illegal seek
    at sun.nio.ch.FileChannelImpl.position0(Native Method)
    at sun.nio.ch.FileChannelImpl.position(FileChannelImpl.java:288)
    at krasa.grepconsole.action.OpenFileInConsoleAction$MyProcess.<init>(OpenFileInConsoleAction.java:119)
    ... 39 more