feat(workspace): preserve terminal sessions across view changes

This commit is contained in:
2026-09-04 14:54:05 +09:00
parent cb1106f319
commit 01017f03fe
4 changed files with 101 additions and 31 deletions
+15 -6
View File
@@ -977,7 +977,7 @@ function buildCustomModuleFiles(input: CustomModuleScaffoldInput): Record<string
" maintainer_email='student@autonomy-studio.local',",
` description='${module.name}',`,
" license='Apache-2.0',",
` entry_points={{'console_scripts': ['${executable} = ${module.packageName}.node:main']}},`,
` entry_points={'console_scripts': ['${executable} = ${module.packageName}.node:main']},`,
')',
'',
].join('\n'),
@@ -4287,7 +4287,13 @@ function buildNav2DockerBuildScript(): string {
'fi',
'',
'MODULE_PATH="$MODULE_ROOT/$MODULE_FOLDER"',
'test -d "$MODULE_PATH/src" || { echo "Module source is missing: $MODULE_FOLDER" >&2; exit 1; }',
'if [[ "$MODULE_FOLDER" == *lms-nav2-custom* ]]; then',
' test -f "$MODULE_PATH/package.xml" || { echo "Custom module source is missing: $MODULE_FOLDER" >&2; exit 1; }',
' SOURCE_BASE_PATH=.',
'else',
' test -d "$MODULE_PATH/src" || { echo "Module source is missing: $MODULE_FOLDER" >&2; exit 1; }',
' SOURCE_BASE_PATH=src',
'fi',
'BUILD_CONTAINER="nav2-build-${TARGET}"',
'cleanup() {',
' docker run --rm -v "$MODULE_ROOT:/modules" "$IMAGE" bash -lc "chown -R $(id -u):$(id -g) \'/modules/$MODULE_FOLDER/build\' \'/modules/$MODULE_FOLDER/install\' \'/modules/$MODULE_FOLDER/log\' 2>/dev/null || true" >/dev/null 2>&1 || true',
@@ -4302,10 +4308,13 @@ function buildNav2DockerBuildScript(): string {
" \"$IMAGE\" bash -lc '",
' set -e',
' source /opt/ros/humble/setup.bash',
' mapfile -t paths < <(colcon list --base-paths src --paths-only)',
' mapfile -t paths < <(colcon list --base-paths "$3" --paths-only)',
' ROSDEP_SKIP_ARGS=()',
' if [[ "$1" == *lms-nav2-custom* ]]; then',
' ROSDEP_SKIP_ARGS+=(--skip-keys ament_python)',
' fi',
' if ! apt-cache show ros-humble-gazebo-ros >/dev/null 2>&1; then',
' ROSDEP_SKIP_ARGS=(--skip-keys gazebo_ros)',
' ROSDEP_SKIP_ARGS+=(--skip-keys gazebo_ros)',
' fi',
" rosdep install --from-paths \"${paths[@]}\" --ignore-src \"${ROSDEP_SKIP_ARGS[@]}\" \\",
" --dependency-types buildtool --dependency-types build \\",
@@ -4314,9 +4323,9 @@ function buildNav2DockerBuildScript(): string {
' if [[ "$1" == *lms-nav2-gazebo-slam* && "$1" != *lms-nav2-gazebo-slam3d* ]]; then',
' BUILD_TARGETS=(slam_pkg slam2d_pkg slam3d_pkg)',
' fi',
" colcon --log-base log build --base-paths src --build-base build --install-base install \\",
" colcon --log-base log build --base-paths \"$3\" --build-base build --install-base install \\",
' --executor sequential --cmake-args -DBUILD_TESTING=OFF --packages-up-to "${BUILD_TARGETS[@]}"',
"' bash \"$MODULE_FOLDER\" \"$TARGET\"",
"' bash \"$MODULE_FOLDER\" \"$TARGET\" \"$SOURCE_BASE_PATH\"",
''
].join('\n')
}