@@ -107,18 +107,6 @@ def after_suspend():
107107 after_suspend = after_suspend ) as repl :
108108 repl .height , repl .width = window .t .height , window .t .width
109109
110- if interactive :
111- # Add custom help command
112- # TODO: add methods to run the code
113- repl .coderunner .interp .locals ['_repl' ] = repl
114-
115- repl .coderunner .interp .runsource (
116- 'from bpython.curtsiesfrontend._internal import _Helper' )
117- repl .coderunner .interp .runsource ('help = _Helper(_repl)\n ' )
118-
119- del repl .coderunner .interp .locals ['_repl' ]
120- del repl .coderunner .interp .locals ['_Helper' ]
121-
122110 def process_event (e ):
123111 """If None is passed in, just paint the screen"""
124112 try :
@@ -134,8 +122,19 @@ def process_event(e):
134122 scrolled = window .render_to_terminal (array , cursor_pos )
135123 repl .scroll_offset += scrolled
136124
137- # run startup file
138125 if interactive :
126+ # Add custom help command
127+ # TODO: add methods to run the code
128+ repl .coderunner .interp .locals ['_repl' ] = repl
129+
130+ repl .coderunner .interp .runsource (
131+ 'from bpython.curtsiesfrontend._internal import _Helper' )
132+ repl .coderunner .interp .runsource ('help = _Helper(_repl)\n ' )
133+
134+ del repl .coderunner .interp .locals ['_repl' ]
135+ del repl .coderunner .interp .locals ['_Helper' ]
136+
137+ # run startup file
139138 process_event (bpythonevents .RunStartupFileEvent ())
140139
141140 # handle paste
0 commit comments