Skip to content

Commit

Permalink
Don't change dir to GF directory #50
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanrhu committed Apr 14, 2022
1 parent f3103a4 commit 022dd9a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,12 @@ def exiting():
terminate_sub_procs = False
exit(1)

os.chdir(os.path.dirname(os.path.realpath(__file__)))
subprocess.Popen([tmux_executable, "kill-session", "-t", terminal_id], stdout=subprocess.PIPE, stderr=subprocess.PIPE).wait()

if not is_random_port:
os.system(
tmux_executable +
" -f tmux.conf new-session -s " + terminal_id +
" -f \"" + path + "/tmux.conf\" new-session -s " + terminal_id +
" -d '" + gdb_executable +
" " + gdb_args +
" -ex \"python import sys, os; sys.path.insert(0, \\\""+path+"\\\"); import config, json, base64; config.init(); " +
Expand All @@ -343,13 +342,13 @@ def exiting():
else:
os.system(
tmux_executable +
" -f tmux.conf new-session -d -s " + terminal_id
" -f \"" + path + "/tmux.conf\" new-session -d -s " + terminal_id
)

if config.WORKDIR:
os.system(
tmux_executable +
" -f tmux.conf send-keys -t " + terminal_id +
" -f \"" + path + "/tmux.conf\" send-keys -t " + terminal_id +
" \"cd " + config.WORKDIR + "\"" +
" ENTER"
)
Expand Down Expand Up @@ -391,7 +390,7 @@ def exiting():
else:
os.system(
tmux_executable +
" -f tmux.conf send-keys -t " + terminal_id +
" -f \"" + path + "/tmux.conf\" send-keys -t " + terminal_id +
" \"" +
gdb_executable +
" " + gdb_args +
Expand All @@ -401,7 +400,7 @@ def exiting():
)
os.system(
tmux_executable +
" -f tmux.conf send-keys -t " + terminal_id +
" -f \"" + path + "/tmux.conf\" send-keys -t " + terminal_id +
" ENTER"
)

Expand Down

0 comments on commit 022dd9a

Please sign in to comment.