How does main process start render process in Atom?


I’m trying to trace the startup sequence in Atom and it’s pretty straightforward for the main process, following (in the src/browser folder) to atom-application to atom-window where the path is loaded and the browserwindow object is created. What I haven’t been able to figure out is how this then interact with the render process.

Can someone please explain specifically how the main process triggers the render process? What is the entry point into the render process? For example, where are the initial window and panes created? And how are the load paths in the main process then causing new text-editors to be created?

Thanks for your help.



Of course after I posted this I found where src/browser/ calls src/ (lines 415-418, in the openPaths method), which then creates the AtomEnvironment and ApplicationDelegate classes on the render method. That answers the entry point question. Now I just need to find the connection between the open paths event on the main process and the render process.



I have a whole breakdown of the startup process of Atom here:

The openURIInPane method is where the opening magic happens:


Thanks. I swear I searched for the answer for quite a while before posting. Best - Andrew


Just FYI, it looks like the load process has changed since you wrote that post “Browser and Node Integration concepts.” The has been replaced with the script, and is invoked in a different place.


Actually I was mistaken earlier. The src/ script is only loaded in the src/browser/ (not run), where it is passed through to the file and encoded in the url call that loads the static/index.html file. This runs index.js, where the load settings are parsed, and the script is finally run on line 86.


For posterity, here are the results of my tracing the load process. Please point out any mistakes and I will fix them.


  • parses command line args and creates AtomApplication (line 39) by calling

  • open(options) method
    • “static” factory method where actual AtomApplication object is created
    • registers ‘application:*’ events
    • checks if app is running tests, opening a file, or opening a url
    • openPaths() is the method that opens files
      • requires the src/ script, which is passed on to the AtomWindow obj
      • either creates a new AtomWindow with the locations to open or tells an existing window to open the locations

  • creates the BrowserWindow object
  • collects the load settings
  • tells the browser window to load the static/index.html file, passing the load settings as url encoded json



  • basically just an html shell that calls index.js


  • entry point for the render process
  • receives the encoded load settings from the main process (via atom-application and atom-window) in the query string
  • pre-load:
    • parses load settings
    • sets the process.env.ATOM_HOME global var as passed in via load settings
    • sets window background styling
  • onLoad()
    • creates the FileSystemBlobStore blobStore for path ATOM_HOME/blob-store
    • calls setupWindow(loadsSettings), which:
      • sets up caches and crash reporter
      • retrieves the script from loadSettings.windowInitializationScript
      • runs the initialize script, passing in the blobStore (render, in src directory)

  • creates the AtomEnvironment
  • creates the ApplicationDelegate object
  • assigns the AtomEnvironment object to ‘window.atom’ in the global context and assigns the ApplicationDelegate object to the applicationDelegate property of the AtomEnvironment
  • calls atom.displayWindow(), which sets window dimensions, shows the window, and sets it to have focus
    • displayWindow() actually calls the show() method, which calls the applicationDelegate.showWindow() method, which sends an ipc message with the command: ipc.send(“call-window-method”, “show”). This is received in the browser AtomApplication class, which passes the show command to the appropriate BrowserWindow object
  • calls atom.startEditorWindow(), which is where the workspace & editor environment that the user interacts with is created
    • loads default keymaps
    • loads packages
    • adds the workspace view to the document.body
    • activates the loaded packages
    • runs the user init script
    • updates the menu
    • opens an initial empty editor