LightTable icon indicating copy to clipboard operation
LightTable copied to clipboard

'light' script always opens a new window

Open chriswatrous opened this issue 9 years ago • 5 comments

Bug Report

'light' script always starts a new window. I'm not sure if this is a bug or a feature but it would be nice if it would always open files in the same window, or if there was an option to do this.

Steps to Reproduce

  1. To make sure the install is clean, delete the lighttable directory in /Applications and delete "~/Library/Application Support/LightTable".
  2. Download lighttable-0.8.1-mac.tar.gz from LightTable website. It will extract automatically to ~/Downloads/lighttable-0.8.1-mac/
  3. Move lighttable-0.8.1-mac dir to /Applications.
  4. Start LightTable with <command>+<space> lighttable <Enter>.
  5. In terminal window, in home dir, run
    • /Applications/lighttable-0.8.1-mac/light .bashrc

This will start a new window with .bashrc. Repeating the script call will always open a new window.

Environment

Info Details
Light Table version 0.8.1
Binary Version 0.34.5
Operating system macOS Sierra 10.12.2

No extra plugins. No modifications to user.keymap or user.behaviors.

Error Messages

On first startup with command+space method:

Failed to open path '/Users/chris/Library/Application Support/LightTable/ltcache/default.clj' with error: Error: ENOENT: no such file or directory, open '/Users/chris/Library/Application Support/LightTable/ltcache/default.clj'

Later starups using the command+space method produce no errors.

Terminal output when calling the 'light' script:

[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0

chriswatrous avatar Dec 30 '16 06:12 chriswatrous

Unfortunately, I do not have access to any macOS, but hopefully someone else is able to confirm this is a bug (or a feature request).

sbauer322 avatar Jan 02 '17 03:01 sbauer322

There is some relevant discussion about this topic at the Light Table forum, for Windows, at least:

https://groups.google.com/forum/#!topic/light-table-discussion/ZvKRV_lY_hk

sbauer322 avatar Jan 18 '17 02:01 sbauer322

This is an issue on the latest version of macOS (10.12.4) at the very least. Discussion on https://github.com/tmux/tmux/issues/475 offers the following code to prevent the error messages: export EVENT_NOKQUEUE=1. Unfortunately, this does nothing to prevent new windows from opening.

jkroes avatar May 11 '17 22:05 jkroes

Thank you for confirming the issue exists, @jkroes.

sbauer322 avatar May 18 '17 01:05 sbauer322

@sbauer322 if we replace the last line of the script to the one using open -a ${APP_DIR}/LightTable.app/ --args $@, then the files are always opened in one LightTable instance. Documentation

The problem is, however, that if we use open, then we don't get any stdout to the console. I guess, that the problem, that open command doesn't forward any output, this is why it is not printed out. Still, when -h flag is passed, no LightTable instance is created (as intended, since the process will be killed and help output should be generated). Any suggestions?

denis631 avatar May 26 '18 00:05 denis631