Course home · All verified lessons

Verified lesson - Learn Pi

Where Settings Apply

Lesson 01 - the short explanation we approved after completing the local experiment.

Pi has two types of settings:

General settings (Global) - Pi's main settings. They apply in every folder where you use Pi, unless that folder has a different local setting.
Local settings (Local) - Pi settings saved inside a specific folder. They apply only to that folder.
When the same option appears in both places, the local setting wins. Inside that folder, Pi uses the local value instead of the general value.
After changing Pi's settings file (settings.json), close Pi and start it again so it loads the change.
Then start Pi with pi -c to return to the same conversation and continue where you stopped.
After the test, restore the original value and check the settings file again to confirm it was restored.
Tested with a real student flow

Try it with Pi

Use two panes: the Guide on the left gives one prompt; hands-on Pi on the right performs it, asks one question, and waits.

1. Inspect the starting point

Ask Pi to inspect only. Nothing should change.

Show me my general Pi theme and tell me whether this folder has local Pi settings. Do not change anything. Explain the result simply.

Understanding check: explain why the general theme applies when no local setting exists.

2. Add one local setting

Ask Pi to change only the fresh tutorial folder.

Set the Pi theme to light only for this folder. Do not change my general settings. Show me what you changed, but do not restart Pi yet.

Understanding check: explain why this change affects only the current working folder.

3. Restart and observe

Close Pi with Control+D. At the terminal prompt, run pi -c. When the conversation returns, tell Pi:

I'm back. The hands-on pane is light.

Understanding check: explain why the local light value wins over the general dark value.

4. Restore the folder

Restore this folder to its original state by removing the local settings created for this lesson. If the .pi folder is empty, remove it too. Do not change my general settings or restart Pi yet.

Understanding check: explain why Pi may still look light before restarting.

5. Confirm the rollback

Close Pi, run pi -c, and report:

I'm back. The hands-on pane is dark again.

Completion proof: no local settings remain and the general dark theme is active again.

היכן ההגדרות חלות

שיעור 01 — ההסבר הקצר שאישרנו יחד לאחר שסיימנו את הניסוי המקומי.

ל-Pi יש שני סוגים של הגדרות:

הגדרות כלליות (Global) — ההגדרות הראשיות של Pi. הן חלות בכל ספרייה שבה עובדים עם Pi, אלא אם באותה ספרייה הוגדרה הגדרה מקומית אחרת.
הגדרות מקומיות (Local) — הגדרות של Pi שנשמרות בתוך ספרייה מסוימת. הן חלות רק על אותה ספרייה.
כאשר אותה אפשרות מוגדרת גם בהגדרות הכלליות וגם בהגדרות המקומיות, ההגדרה המקומית גוברת. כלומר, בתוך אותה ספרייה Pi ישתמש בהגדרה המקומית ולא בהגדרה הכללית.
לאחר שמשנים את קובץ ההגדרות של Pi (settings.json), צריך לסגור את Pi ולהפעיל אותו מחדש כדי שיטען את השינוי.
לאחר מכן מפעילים את Pi באמצעות pi -c כדי לחזור לאותה שיחה ולהמשיך מהמקום שבו הפסקנו.
בסיום הבדיקה מחזירים את ההגדרה לערך המקורי, ואז בודקים שוב את קובץ ההגדרות כדי לוודא שהערך המקורי אכן שוחזר.
נבדק בתהליך למידה אמיתי

מתרגלים יחד עם Pi

עובדים בשתי חלוניות: המדריך משמאל נותן פרומפט אחד; Pi המעשי מימין מבצע אותו, שואל שאלת הבנה אחת וממתין.

1. בודקים את נקודת ההתחלה

מבקשים מ-Pi לבדוק בלבד. שום דבר לא אמור להשתנות.

הצג לי את ערכת העיצוב הכללית של Pi, ואמור לי אם לתיקייה הזאת יש הגדרות מקומיות של Pi. אל תשנה דבר. הסבר את התוצאה בפשטות.

בדיקת הבנה: הסבר מדוע ההגדרה הכללית חלה כאשר אין הגדרה מקומית.

2. מוסיפים הגדרה מקומית אחת

מבקשים מ-Pi לשנות רק את תיקיית התרגול החדשה.

הגדר את ערכת העיצוב ל-light רק עבור התיקייה הזאת. אל תשנה את ההגדרות הכלליות שלי. הראה לי מה שינית, אבל אל תפעיל מחדש את Pi עדיין.

בדיקת הבנה: הסבר מדוע השינוי משפיע רק על תיקיית העבודה הנוכחית.

3. מפעילים מחדש ורואים את התוצאה

סוגרים את Pi באמצעות Control+D. במסוף מפעילים pi -c. כאשר השיחה חוזרת, כותבים:

חזרתי. חלונית התרגול בהירה עכשיו.

בדיקת הבנה: הסבר מדוע הערך המקומי הבהיר גובר על הערך הכללי הכהה.

4. מחזירים את התיקייה למצב המקורי

החזר את התיקייה למצב המקורי שלה על ידי הסרת ההגדרות המקומיות שנוצרו עבור השיעור הזה. אם התיקייה .pi ריקה, הסר גם אותה. אל תשנה את ההגדרות הכלליות שלי ואל תפעיל מחדש את Pi עדיין.

בדיקת הבנה: הסבר מדוע Pi עדיין עשוי להיראות בהיר לפני ההפעלה מחדש.

5. מאשרים שהשחזור הצליח

סוגרים את Pi, מפעילים pi -c וכותבים:

חזרתי. חלונית התרגול כהה שוב.

הוכחת השלמה: לא נשארו הגדרות מקומיות, וערכת העיצוב הכללית הכהה פעילה שוב.

Continue learning

Return to all verified lessons or open the course home.