Skip to content

Commit 408dd48

Browse files
committed
default terminal path changed
1 parent 403e121 commit 408dd48

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

app/terminal/manager.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ def create_session(app, session_id, socketio, allow_create=True):
5555
env = os.environ.copy()
5656
env['TERM'] = 'xterm-256color'
5757
env['BASH_COMPLETION_ENABLED'] = '1'
58-
58+
59+
# Get user's home directory
60+
user_home = os.path.expanduser('~')
61+
5962
# Start bash with completion enabled
6063
process = subprocess.Popen(
6164
['/bin/bash', '--login'],
@@ -64,6 +67,7 @@ def create_session(app, session_id, socketio, allow_create=True):
6467
stderr=slave,
6568
start_new_session=True,
6669
env=env,
70+
cwd=user_home, # Agregar esta línea
6771
close_fds=True
6872
)
6973

app/terminal/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ def create_terminal_process(session):
2525
if check_session.returncode == 0:
2626
# Session already exists
2727
return True
28+
29+
# Get user's home directory
30+
user_home = os.path.expanduser('~')
2831

2932
# Create a new session
3033
if session.session_type == 'terminal':
@@ -34,6 +37,7 @@ def create_terminal_process(session):
3437
'-d', # Start detached
3538
'-s', session.session_id, # Session name
3639
'-n', 'main', # Window name
40+
'-c', user_home, # Set working directory to user's home
3741
'bash' # Command to run
3842
], check=True)
3943
elif session.session_type in ['guided', 'direct']:
@@ -52,6 +56,7 @@ def create_terminal_process(session):
5256
'-d', # Start detached
5357
'-s', session.session_id, # Session name
5458
'-n', session.module_name, # Window name
59+
'-c', user_home, # Set working directory to user's home
5560
module_cmd # Command to run
5661
], check=True)
5762

0 commit comments

Comments
 (0)