summaryrefslogtreecommitdiff
path: root/Userland/ls.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2020-01-04 11:38:02 +0100
committerAndreas Kling <awesomekling@gmail.com>2020-01-04 11:38:02 +0100
commit755938c6501815edbe9a7ce2f68025a3453343cb (patch)
tree7e05251a9bae100ce2834bd08a2ddc81cd42981b /Userland/ls.cpp
parente79c33eabbd500cedaa26613f9de758c276f56b8 (diff)
downloadserenity-755938c6501815edbe9a7ce2f68025a3453343cb.zip
ls: Show directories with the sticky bit in a special color
This makes /tmp show up with a green background in "ls" output.
Diffstat (limited to 'Userland/ls.cpp')
-rw-r--r--Userland/ls.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/ls.cpp b/Userland/ls.cpp
index 96f00b6820..bcf744c751 100644
--- a/Userland/ls.cpp
+++ b/Userland/ls.cpp
@@ -105,7 +105,9 @@ int print_name(const struct stat& st, const String& name, const char* path_for_l
const char* begin_color = "";
const char* end_color = "\033[0m";
- if (S_ISLNK(st.st_mode))
+ if (st.st_mode & S_ISVTX)
+ begin_color = "\033[42;30;1m";
+ else if (S_ISLNK(st.st_mode))
begin_color = "\033[36;1m";
else if (S_ISDIR(st.st_mode))
begin_color = "\033[34;1m";