Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tavern/tomes/process_tree/main.eldritch
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,22 @@ def depth_first_search(visited, process_tree, current_proc_pid, padding, process
if padding > 0:
padding_string = (padding - 1) * " " + " \_ "

if current_proc_pid != "0":
if current_proc_pid != "0" and current_proc_pid in process_list_dictionary:
print(
pad_pid(current_proc_pid) +\
pad_pid(process_list_dictionary[current_proc_pid]["ppid"]) +\
pad_username(process_list_dictionary[current_proc_pid]["username"]) +\
padding_string + process_list_dictionary[current_proc_pid]["command"].replace("\n","\\n")
)
else:
print(
pad_pid(current_proc_pid) +\
pad_pid("???") +\
pad_username("???") +\
padding_string + "???".replace("\n","\\n")
)



padding = padding + 1

Expand Down Expand Up @@ -76,3 +85,4 @@ time.sleep(1)

process_tree(input_params['cmd_substring'])
print("")

Loading